| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
- MWF.require("MWF.widget.Tab", null, false);
- MWF.xApplication.process.Xform.Tab = MWF.APPTab = new Class({
- Extends: MWF.APP$Module,
- _loadUserInterface: function(){
- this.elements = [];
- this.containers = [];
- var style = "form";
- if (layout.mobile) style = "mobileForm";
- this.tab = new MWF.widget.Tab(this.node, {"style": style});
-
- this._setTabWidgetStyles();
- this.tab.tabNodeContainer = this.node.getFirst("div");
- this.tab.contentNodeContainer = this.tab.tabNodeContainer.getNext("div");
- var lastNode = this.tab.tabNodeContainer.getLast();
- var tabs;
- if (lastNode && lastNode.hasClass("tabNodeContainerLeft")){
- this.tab.tabNodeContainerRight = this.tab.tabNodeContainer.getFirst();
- this.tab.tabNodeContainerLeft = lastNode;
- this.tab.tabNodeContainerArea = lastNode.getFirst();
- var menuNode = this.node.getElement(".MWFMenu");
- if (menuNode) menuNode.destroy();
- this.tab.load();
- tabs = this.tab.tabNodeContainerArea.getChildren("div");
- }else{
- tabs = this.tab.tabNodeContainer.getChildren("div");
- this.tab.load();
- }
- var contents = this.tab.contentNodeContainer.getChildren("div");
- tabs.each(function(tab, idx){
- this.tab.rebuildTab(contents[idx], contents[idx].getFirst(), tab);
- }.bind(this));
-
- this.tab.pages[0]._showTab();
- this.loadSubModule();
- },
- loadSubModule: function(){
- this.tab.pages.each(function(page){
- var node = page.tabNode;
- var json = this.form._getDomjson(node);
- var tab = this;
- var module = this.form._loadModule(json, node, function(){
- this.tab = tab;
- });
- this.elements.push(module);
- this.form.modules.push(module);
- if (page.isShow){
- this.showContentModule.call(page, this);
- }else{
- if (this.json.isDelay){
- var _self = this;
- page.showContentModuleFun = function(){_self.showContentModule.call(page, _self)};
- page.addEvent("show", page.showContentModuleFun);
- }else{
- this.showContentModule.call(page, this);
- }
- }
- }.bind(this));
- },
- showContentModule: function(_self){
- var node = this.contentNode;
- node.isLoadModule = true;
- json = _self.form._getDomjson(node);
- tab = _self;
- module = _self.form._loadModule(json, node, function(){
- this.tab = tab;
- });
- _self.containers.push(module);
- _self.form.modules.push(module);
- if (this.showContentModuleFun) this.removeEvent("show", this.showContentModuleFun);
- },
- _setTabWidgetStyles: function(){
- if (this.json.tabNodeContainer) this.tab.css.tabNodeContainer = Object.clone(this.json.tabNodeContainer);
- if (this.json.contentNodeContainer) this.tab.css.contentNodeContainer = Object.clone(this.json.contentNodeContainer);
- this.tab.css.tabNode = Object.clone(this.json.tabStyles);
- this.tab.css.tabTextNode = Object.clone(this.json.tabTextStyles);
- this.tab.css.tabNodeCurrent = Object.clone(this.json.tabCurrentStyles);
- this.tab.css.tabTextNodeCurrent = Object.clone(this.json.tabTextCurrentStyles);
- }
- });
- MWF.xApplication.process.Xform.tab$Page = MWF.APPTab$Page = new Class({
- Extends: MWF.APP$Module
- });
- MWF.xApplication.process.Xform.tab$Content = MWF.APPTab$Content = new Class({
- Extends: MWF.APP$Module,
- _loadUserInterface: function(){
- this.form._loadModules(this.node);
- }
- });
|