mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +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');
|
||||
//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
|
||||
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -446,3 +446,23 @@ window.location.changed = function(e){};
|
||||
}
|
||||
}, 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