mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix popup javascript (#16459)
Breaking out the code to a script tab seems to have interacted poorly with some code. Put it in librenms.js for now to avoid issues.
This commit is contained in:
@@ -26,38 +26,3 @@
|
||||
@endisset
|
||||
</div>
|
||||
</div>
|
||||
@once
|
||||
<script>
|
||||
document.addEventListener("alpine:init", () => {
|
||||
Alpine.data("popup", () => ({
|
||||
popupShow: false,
|
||||
showTimeout: null,
|
||||
hideTimeout: null,
|
||||
ignoreNextShownEvent: false,
|
||||
delay: 300,
|
||||
show(timeout) {
|
||||
clearTimeout(this.hideTimeout);
|
||||
this.showTimeout = setTimeout(() => {
|
||||
this.popupShow = true;
|
||||
Popper.createPopper(this.$refs.targetRef, this.$refs.popupRef, {
|
||||
padding: 8
|
||||
});
|
||||
|
||||
// close other popups, except this one
|
||||
this.ignoreNextShownEvent = true;
|
||||
this.$dispatch('librenms-popup-shown', this.$el);
|
||||
}, timeout);
|
||||
},
|
||||
hide(timeout) {
|
||||
if (this.ignoreNextShownEvent) {
|
||||
this.ignoreNextShownEvent = false;
|
||||
return;
|
||||
}
|
||||
|
||||
clearTimeout(this.showTimeout);
|
||||
this.hideTimeout = setTimeout(() => this.popupShow = false, timeout)
|
||||
}
|
||||
}));
|
||||
});
|
||||
</script>
|
||||
@endonce
|
||||
|
@@ -76,7 +76,7 @@
|
||||
});
|
||||
var ajax_url = "{{ url('/ajax') }}";
|
||||
</script>
|
||||
<script src="{{ asset('js/librenms.js?ver=22052024') }}"></script>
|
||||
<script src="{{ asset('js/librenms.js?ver=29092024') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('js/overlib_mini.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('js/toastr.min.js?ver=05072021') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('js/boot.js?ver=10272021') }}"></script>
|
||||
|
Reference in New Issue
Block a user