summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorltGuillaume <[email protected]>2019-05-07 14:34:15 +0000
committerltGuillaume <[email protected]>2019-05-07 14:34:15 +0000
commit44bfbc95292d194f51abf58677b0b595101152cd (patch)
tree22e962efb5e0a67527d358821d30010207760d86
parent84d43a1b445f0e79a71e7466cdf746181865f492 (diff)
Allow to unregister plugin hooks
-rw-r--r--js/PluginHost.js5
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);
}
};