diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-17 02:19:08 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-17 02:19:08 +0200 |
commit | 078664bc34403bf18e0ae6ea3e0ccba308cf8df6 (patch) | |
tree | d3561bdc7b6577121a79cf686fad7be6247f906e /pyload/webui/themes/flat/js/static/MooDropMenu.js | |
parent | New theme Estate (diff) | |
download | pyload-078664bc34403bf18e0ae6ea3e0ccba308cf8df6.tar.xz |
[themes] Code cosmetics
Diffstat (limited to 'pyload/webui/themes/flat/js/static/MooDropMenu.js')
-rw-r--r-- | pyload/webui/themes/flat/js/static/MooDropMenu.js | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/pyload/webui/themes/flat/js/static/MooDropMenu.js b/pyload/webui/themes/flat/js/static/MooDropMenu.js index ac0fa1874..08dc79c1e 100644 --- a/pyload/webui/themes/flat/js/static/MooDropMenu.js +++ b/pyload/webui/themes/flat/js/static/MooDropMenu.js @@ -19,68 +19,68 @@ provides: [MooDropMenu, Element.MooDropMenu] var MooDropMenu = new Class({ - Implements: [Options, Events], + Implements: [Options, Events], - options: { - onOpen: function(el){ - el.removeClass('close').addClass('open'); - }, - onClose: function(el){ - el.removeClass('open').addClass('close'); - }, - onInitialize: function(el){ - el.removeClass('open').addClass('close'); - }, - mouseoutDelay: 200, - mouseoverDelay: 0, - listSelector: 'ul', - itemSelector: 'li', - openEvent: 'mouseenter', - closeEvent: 'mouseleave' - }, + options: { + onOpen: function(el){ + el.removeClass('close').addClass('open'); + }, + onClose: function(el){ + el.removeClass('open').addClass('close'); + }, + onInitialize: function(el){ + el.removeClass('open').addClass('close'); + }, + mouseoutDelay: 200, + mouseoverDelay: 0, + listSelector: 'ul', + itemSelector: 'li', + openEvent: 'mouseenter', + closeEvent: 'mouseleave' + }, - initialize: function(menu, options, level){ - this.setOptions(options); - options = this.options; + initialize: function(menu, options, level){ + this.setOptions(options); + options = this.options; - var menu = this.menu = document.id(menu); + var menu = this.menu = document.id(menu); - menu.getElements(options.itemSelector + ' > ' + options.listSelector).each(function(el){ + menu.getElements(options.itemSelector + ' > ' + options.listSelector).each(function(el){ - this.fireEvent('initialize', el); + this.fireEvent('initialize', el); - var parent = el.getParent(options.itemSelector), - timer; + var parent = el.getParent(options.itemSelector), + timer; - parent.addEvent(options.openEvent, function(){ - parent.store('DropDownOpen', true); + parent.addEvent(options.openEvent, function(){ + parent.store('DropDownOpen', true); - clearTimeout(timer); - if (options.mouseoverDelay) timer = this.fireEvent.delay(options.mouseoverDelay, this, ['open', el]); - else this.fireEvent('open', el); + clearTimeout(timer); + if (options.mouseoverDelay) timer = this.fireEvent.delay(options.mouseoverDelay, this, ['open', el]); + else this.fireEvent('open', el); - }.bind(this)).addEvent(options.closeEvent, function(){ - parent.store('DropDownOpen', false); + }.bind(this)).addEvent(options.closeEvent, function(){ + parent.store('DropDownOpen', false); - clearTimeout(timer); - timer = (function(){ - if (!parent.retrieve('DropDownOpen')) this.fireEvent('close', el); - }).delay(options.mouseoutDelay, this); + clearTimeout(timer); + timer = (function(){ + if (!parent.retrieve('DropDownOpen')) this.fireEvent('close', el); + }).delay(options.mouseoutDelay, this); - }.bind(this)); + }.bind(this)); - }, this); - }, + }, this); + }, - toElement: function(){ - return this.menu - } + toElement: function(){ + return this.menu + } }); /* So you can do like this $('nav').MooDropMenu(); or even $('nav').MooDropMenu().setStyle('border',1); */ Element.implement({ - MooDropMenu: function(options){ - return this.store('MooDropMenu', new MooDropMenu(this, options)); - } + MooDropMenu: function(options){ + return this.store('MooDropMenu', new MooDropMenu(this, options)); + } }); |