diff options
author | ltGuillaume <[email protected]> | 2019-05-07 14:34:15 +0000 |
---|---|---|
committer | ltGuillaume <[email protected]> | 2019-05-07 14:34:15 +0000 |
commit | 44bfbc95292d194f51abf58677b0b595101152cd (patch) | |
tree | 22e962efb5e0a67527d358821d30010207760d86 /js/PluginHost.js | |
parent | 84d43a1b445f0e79a71e7466cdf746181865f492 (diff) |
Allow to unregister plugin hooks
Diffstat (limited to 'js/PluginHost.js')
-rw-r--r-- | js/PluginHost.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/js/PluginHost.js b/js/PluginHost.js index 06b79ac5a..71596ad31 100644 --- a/js/PluginHost.js +++ b/js/PluginHost.js @@ -29,6 +29,11 @@ PluginHost = { for (let i = 0; i < this.hooks[name].length; i++) { this.hooks[name][i](args); } + }, + unregister: function (name, callback) { + for (var i = 0; i < this.hooks[name].length; i++) + if (this.hooks[name][i] == callback) + this.hooks[name].splice(i, 1); } }; |