| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- 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);
- node = page.contentNode;
- json = this.form._getDomjson(node);
- tab = this;
- module = this.form._loadModule(json, node, function(){
- this.tab = tab;
- });
- this.containers.push(module);
- this.form.modules.push(module);
- }.bind(this));
- },
- _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
- });
|