mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
modal.js: Do not open multiple modal windows by clicking more than once
This commit is contained in:
parent
414a2ff7aa
commit
15b9bac755
@ -42,6 +42,11 @@
|
|||||||
var $modal = _this.$ghost.clone();
|
var $modal = _this.$ghost.clone();
|
||||||
var $urlTarget = _this.icinga.loader.getLinkTargetFor($a, false);
|
var $urlTarget = _this.icinga.loader.getLinkTargetFor($a, false);
|
||||||
|
|
||||||
|
_this.modalOpener = event.currentTarget;
|
||||||
|
|
||||||
|
// Disable pointer events to block further function calls
|
||||||
|
_this.modalOpener.style.pointerEvents = 'none';
|
||||||
|
|
||||||
// Add showCompact, we don't want controls in a modal
|
// Add showCompact, we don't want controls in a modal
|
||||||
url = _this.icinga.utils.addUrlFlag(url, 'showCompact');
|
url = _this.icinga.utils.addUrlFlag(url, 'showCompact');
|
||||||
|
|
||||||
@ -189,6 +194,10 @@
|
|||||||
* @param $modal {jQuery} The modal element
|
* @param $modal {jQuery} The modal element
|
||||||
*/
|
*/
|
||||||
Modal.prototype.hide = function($modal) {
|
Modal.prototype.hide = function($modal) {
|
||||||
|
// Remove pointerEvent none style to make the button clickable again
|
||||||
|
this.modalOpener.style.pointerEvents = '';
|
||||||
|
this.modalOpener = null;
|
||||||
|
|
||||||
$modal.removeClass('active');
|
$modal.removeClass('active');
|
||||||
// Using `setTimeout` here to let the transition finish
|
// Using `setTimeout` here to let the transition finish
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user