From c0908e32ba4fd7fd02bdcc00d1f9870e8540ad74 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 10 Sep 2014 10:47:45 +0200 Subject: [PATCH] Remove unused behavior base-class --- public/js/icinga/behavior.js | 70 ------------------------------------ 1 file changed, 70 deletions(-) delete mode 100644 public/js/icinga/behavior.js diff --git a/public/js/icinga/behavior.js b/public/js/icinga/behavior.js deleted file mode 100644 index 4e1e570f9..000000000 --- a/public/js/icinga/behavior.js +++ /dev/null @@ -1,70 +0,0 @@ -// {{{ICINGA_LICENSE_HEADER}}} -// {{{ICINGA_LICENSE_HEADER}}} - -(function(Icinga) { - - /** - * Used to define a set of functionality that can be applied - * on a subtree of the site's DOM - * - * Behaviors - * - * @constructor - */ - Icinga.Behavior = function () { - this.handler = { - apply: [], - bind: [], - unbind: [] - }; - }; - - Icinga.Behavior.prototype.on = function(evt, fn) { - this.handler[evt].push(fn); - }; - - Icinga.Behavior.prototype.off = function(evt, fn) { - this.handler[evt].remove(fn); - }; - - Icinga.Behavior.prototype.trigger = function(evt, el) { - var handler = this.handler[evt]; - for (var i = 0; i < handler.length; i++) { - if (typeof handler[i] === 'function') { - handler[i](el); - } - } - }; - - Icinga.Behavior.prototype.onApply = function(fn) { - this.on('apply', fn); - }; - - Icinga.Behavior.prototype.onBind = function(fn) { - this.on('bind', fn); - }; - - Icinga.Behavior.prototype.onUnbind = function(fn) { - this.on('unbind', fn); - }; - - Icinga.Behavior.prototype.apply = function(el) { - this.trigger ('apply', el); - }; - - Icinga.Behavior.prototype.bind = function(el) { - this.trigger ('bind', el); - }; - - Icinga.Behavior.prototype.unbind = function(el) { - this.trigger ('apply', el); - }; - - Icinga.Behavior.prototype.off = function() { - this.handler = { - apply: [], - bind: [], - unbind: [] - }; - }; -}) (Icinga); \ No newline at end of file