diff options
author | 2014-08-24 16:00:27 +0200 | |
---|---|---|
committer | 2014-08-24 16:00:27 +0200 | |
commit | df888fad2bd1697f6c61930c486242764184d638 (patch) | |
tree | 290e04ade53e7f01ae74b2c7f886f711e8062afa /module/web/media/js/tinytab_static.js | |
parent | [MultiHoster] Fixed crash due to getConf deprecation (diff) | |
download | pyload-df888fad2bd1697f6c61930c486242764184d638.tar.xz |
Revert 8446e16346ece5a934550f69e81d0cad528f7fba. It broke the WebUI.
Diffstat (limited to 'module/web/media/js/tinytab_static.js')
-rw-r--r-- | module/web/media/js/tinytab_static.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/module/web/media/js/tinytab_static.js b/module/web/media/js/tinytab_static.js new file mode 100644 index 000000000..4146038a5 --- /dev/null +++ b/module/web/media/js/tinytab_static.js @@ -0,0 +1,50 @@ +/* +--- +description: TinyTab - Tiny and simple tab handler for Mootools. + +license: MIT-style + +authors: +- Danillo César de O. Melo + +requires: +- core/1.2.4: '*' + +provides: TinyTab + +... +*/ +(function($) { + this.TinyTab = new Class({ + Implements: Events, + initialize: function(tabs, contents, opt) { + this.tabs = tabs; + this.contents = contents; + this.header = $("tabsback"); + this.headers = []; + for(var i =0; i < this.tabs.length; i++){ + this.headers.push(""); + } + if(!opt) opt = {}; + this.css = opt.selectedClass || 'selected'; + this.select(this.tabs[0]); + tabs.each(function(el){ + el.addEvent('click',function(e){ + this.select(el); + e.stop(); + }.bind(this)); + }.bind(this)); + }, + + select: function(el) { + this.tabs.removeClass(this.css); + el.addClass(this.css); + this.contents.setStyle('display','none'); + var index = this.tabs.indexOf(el); + this.header.set("text", this.headers[index]); + var content = this.contents[index]; + content.setStyle('display','block'); + this.fireEvent('change',[content,el]); + } + }); +})(document.id); |