mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 05:49:22 +00:00
Make emoji picker close automatically if input parent element is destroyed
This commit is contained in:
parent
b05a26d734
commit
3cee773de0
14
assets/3rdparty/wdt-emoji/wdt-emoji-bundle.js
vendored
14
assets/3rdparty/wdt-emoji/wdt-emoji-bundle.js
vendored
@ -289,6 +289,20 @@
|
|||||||
|
|
||||||
addClass(this, 'wdt-emoji-picker-open');
|
addClass(this, 'wdt-emoji-picker-open');
|
||||||
//this.innerHTML = wdtEmojiBundle.emoji.replace_colons(':sunglasses:'); //COMUNIC - EDIT
|
//this.innerHTML = wdtEmojiBundle.emoji.replace_colons(':sunglasses:'); //COMUNIC - EDIT
|
||||||
|
|
||||||
|
|
||||||
|
//COMUNIC EDIT
|
||||||
|
//Make the picker close automatically if the parent element is removed
|
||||||
|
var interval = setInterval(function(){
|
||||||
|
if(!parent.isConnected){
|
||||||
|
wdtEmojiBundle.close();
|
||||||
|
clearInterval(interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
}, 2500);
|
||||||
|
//END COMUNIC EDIT
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -445,4 +445,24 @@ window.location.changed = function(e){};
|
|||||||
window.location.changed(window.location);
|
window.location.changed(window.location);
|
||||||
}
|
}
|
||||||
}, 900);
|
}, 900);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jQuery special event that detects the deletion
|
||||||
|
* of a DOM element
|
||||||
|
*
|
||||||
|
* @source StackOverFlow answer from mtkopone
|
||||||
|
*/
|
||||||
|
(function($){
|
||||||
|
|
||||||
|
$.event.special.destroyed = {
|
||||||
|
|
||||||
|
remove: function(o){
|
||||||
|
if(o.handler)
|
||||||
|
o.handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})(jQuery);
|
Loading…
Reference in New Issue
Block a user