summaryrefslogtreecommitdiff
path: root/assets/js/core/base.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/core/base.js')
-rw-r--r--assets/js/core/base.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/assets/js/core/base.js b/assets/js/core/base.js
index 0ab06d78..6bfe22ba 100644
--- a/assets/js/core/base.js
+++ b/assets/js/core/base.js
@@ -27,6 +27,16 @@ KB.trigger = function (eventType, eventData) {
}
};
+KB.removeListener = function (eventType, callback) {
+ if (this.listeners.internals.hasOwnProperty(eventType)) {
+ for (var i = 0; i < this.listeners.internals[eventType].length; i++) {
+ if (this.listeners.internals[eventType][i] === callback) {
+ this.listeners.internals[eventType].splice(i, 1);
+ }
+ }
+ }
+};
+
KB.onClick = function (selector, callback) {
this.listeners.clicks[selector] = callback;
};