o2.widget = o2.widget || {}; o2.widget.Tab = new Class({ Implements: [Options, Events], Extends: o2.widget.Common, options: { "style": "default" }, initialize: function(container, options){ this.setOptions(options); this.pages = []; this.path = o2.session.path+"/widget/$Tab/"; this.cssPath = o2.session.path+"/widget/$Tab/"+this.options.style+"/css.wcss"; this._loadCss(); this.css = Object.clone(this.css); this.showPage = null; this.node = $(container); }, load: function(){ if (this.fireEvent("queryLoad")){ if (!this.tabNodeContainer) this.tabNodeContainer = new Element("div"); this.tabNodeContainer.set("styles", this.css.tabNodeContainer); this.tabNodeContainer.inject(this.node); if (!this.tabNodeContainerRight) this.tabNodeContainerRight = new Element("div.tabNodeContainerRight"); this.tabNodeContainerRight.set("styles", this.css.tabNodeContainerRight); this.tabNodeContainerRight.inject(this.tabNodeContainer); if (!this.tabNodeContainerLeft) this.tabNodeContainerLeft = new Element("div.tabNodeContainerLeft"); this.tabNodeContainerLeft.set("styles", this.css.tabNodeContainerLeft); this.tabNodeContainerLeft.inject(this.tabNodeContainer); if (!this.tabNodeContainerArea) this.tabNodeContainerArea = new Element("div.tabNodeContainerArea"); this.tabNodeContainerArea.set("styles", this.css.tabNodeContainerArea); this.tabNodeContainerArea.inject(this.tabNodeContainerLeft); if (!this.contentNodeContainer) this.contentNodeContainer = new Element("div"); this.contentNodeContainer.set("name", "MWFcontentNodeContainer"); this.contentNodeContainer.set("styles", this.css.contentNodeContainer); this.contentNodeContainer.inject(this.node); this.tabNodeContainerRight.addEvents({ "mouseover": function(){this.tabNodeContainerRight.setStyles(this.css.tabNodeContainerRight_over)}.bind(this), "mouseout": function(){this.tabNodeContainerRight.setStyles(this.css.tabNodeContainerRight)}.bind(this) }); o2.require("o2.xDesktop.Menu", function(){ this.tabMenu = new o2.xDesktop.Menu(this.tabNodeContainerRight, { "style": "tab", "event": "click", "container": this.tabNodeContainerRight, "where": {"x": "right", "y": "bottom"}, "onQueryShow": function(){ this.loadOverMenu(); }.bind(this) }); this.tabMenu.load(); }.bind(this)); this.tabNodeContainerRight.hide(); this.fireEvent("postLoad"); } }, rebuildTab: function(contentAreaNode,contentNode, pageNode){ var tabPage = new o2.widget.TabPage(contentNode, "", this, {"isClose": false}); tabPage.contentNodeArea = contentAreaNode; tabPage.tabNode = pageNode; tabPage.textNode = pageNode.getFirst(); tabPage.closeNode = tabPage.textNode.getFirst(); tabPage.options.title = tabPage.textNode.get("text"); tabPage.load(); this.pages.push(tabPage); return tabPage; }, addTab: function(node, title, isclose, pageNode){ var tabPage = new o2.widget.TabPage(node, title, this, {"isClose": isclose, "tabNode": pageNode}); tabPage.load(); this.pages.push(tabPage); return tabPage; }, loadOverMenu: function(e){ this.tabMenu.clearItems(); var _self = this; for (var n=this.showTabIndex; nsize.x) break; } this.showTabIndex = i; if (tabWidth>size.x && i