diff options
author | Andrew Dolgov <[email protected]> | 2012-08-14 18:59:10 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-08-14 18:59:18 +0400 |
commit | 1354d17270961fff662d40f90521223f8fd0d73b (patch) | |
tree | e9266be71587e47c800303446e968a6d3565e2cf /lib/dijit/layout/_TabContainerBase.js | |
parent | d04f8c826f5283765f52cf6b98b42a1ed8f2d6bc (diff) |
update dojo to 1.7.3
Diffstat (limited to 'lib/dijit/layout/_TabContainerBase.js')
-rw-r--r-- | lib/dijit/layout/_TabContainerBase.js | 147 |
1 files changed, 2 insertions, 145 deletions
diff --git a/lib/dijit/layout/_TabContainerBase.js b/lib/dijit/layout/_TabContainerBase.js index 5e07cb653..27e4f86be 100644 --- a/lib/dijit/layout/_TabContainerBase.js +++ b/lib/dijit/layout/_TabContainerBase.js @@ -1,145 +1,2 @@ -/* - Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - - -if(!dojo._hasResource["dijit.layout._TabContainerBase"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dijit.layout._TabContainerBase"] = true; -dojo.provide("dijit.layout._TabContainerBase"); -dojo.require("dijit.layout.StackContainer"); -dojo.require("dijit._Templated"); - - -dojo.declare("dijit.layout._TabContainerBase", - [dijit.layout.StackContainer, dijit._Templated], - { - // summary: - // Abstract base class for TabContainer. Must define _makeController() to instantiate - // and return the widget that displays the tab labels - // description: - // A TabContainer is a container that has multiple panes, but shows only - // one pane at a time. There are a set of tabs corresponding to each pane, - // where each tab has the name (aka title) of the pane, and optionally a close button. - - // tabPosition: String - // Defines where tabs go relative to tab content. - // "top", "bottom", "left-h", "right-h" - tabPosition: "top", - - baseClass: "dijitTabContainer", - - // tabStrip: [const] Boolean - // Defines whether the tablist gets an extra class for layouting, putting a border/shading - // around the set of tabs. Not supported by claro theme. - tabStrip: false, - - // nested: [const] Boolean - // If true, use styling for a TabContainer nested inside another TabContainer. - // For tundra etc., makes tabs look like links, and hides the outer - // border since the outer TabContainer already has a border. - nested: false, - - templateString: dojo.cache("dijit.layout", "templates/TabContainer.html", "<div class=\"dijitTabContainer\">\n\t<div class=\"dijitTabListWrapper\" dojoAttachPoint=\"tablistNode\"></div>\n\t<div dojoAttachPoint=\"tablistSpacer\" class=\"dijitTabSpacer ${baseClass}-spacer\"></div>\n\t<div class=\"dijitTabPaneWrapper ${baseClass}-container\" dojoAttachPoint=\"containerNode\"></div>\n</div>\n"), - - postMixInProperties: function(){ - // set class name according to tab position, ex: dijitTabContainerTop - this.baseClass += this.tabPosition.charAt(0).toUpperCase() + this.tabPosition.substr(1).replace(/-.*/, ""); - - this.srcNodeRef && dojo.style(this.srcNodeRef, "visibility", "hidden"); - - this.inherited(arguments); - }, - - buildRendering: function(){ - this.inherited(arguments); - - // Create the tab list that will have a tab (a.k.a. tab button) for each tab panel - this.tablist = this._makeController(this.tablistNode); - - if(!this.doLayout){ dojo.addClass(this.domNode, "dijitTabContainerNoLayout"); } - - if(this.nested){ - /* workaround IE's lack of support for "a > b" selectors by - * tagging each node in the template. - */ - dojo.addClass(this.domNode, "dijitTabContainerNested"); - dojo.addClass(this.tablist.containerNode, "dijitTabContainerTabListNested"); - dojo.addClass(this.tablistSpacer, "dijitTabContainerSpacerNested"); - dojo.addClass(this.containerNode, "dijitTabPaneWrapperNested"); - }else{ - dojo.addClass(this.domNode, "tabStrip-" + (this.tabStrip ? "enabled" : "disabled")); - } - }, - - _setupChild: function(/*dijit._Widget*/ tab){ - // Overrides StackContainer._setupChild(). - dojo.addClass(tab.domNode, "dijitTabPane"); - this.inherited(arguments); - }, - - startup: function(){ - if(this._started){ return; } - - // wire up the tablist and its tabs - this.tablist.startup(); - - this.inherited(arguments); - }, - - layout: function(){ - // Overrides StackContainer.layout(). - // Configure the content pane to take up all the space except for where the tabs are - - if(!this._contentBox || typeof(this._contentBox.l) == "undefined"){return;} - - var sc = this.selectedChildWidget; - - if(this.doLayout){ - // position and size the titles and the container node - var titleAlign = this.tabPosition.replace(/-h/, ""); - this.tablist.layoutAlign = titleAlign; - var children = [this.tablist, { - domNode: this.tablistSpacer, - layoutAlign: titleAlign - }, { - domNode: this.containerNode, - layoutAlign: "client" - }]; - dijit.layout.layoutChildren(this.domNode, this._contentBox, children); - - // Compute size to make each of my children. - // children[2] is the margin-box size of this.containerNode, set by layoutChildren() call above - this._containerContentBox = dijit.layout.marginBox2contentBox(this.containerNode, children[2]); - - if(sc && sc.resize){ - sc.resize(this._containerContentBox); - } - }else{ - // just layout the tab controller, so it can position left/right buttons etc. - if(this.tablist.resize){ - //make the tabs zero width so that they don't interfere with width calc, then reset - var s = this.tablist.domNode.style; - s.width="0"; - var width = dojo.contentBox(this.domNode).w; - s.width=""; - this.tablist.resize({w: width}); - } - - // and call resize() on the selected pane just to tell it that it's been made visible - if(sc && sc.resize){ - sc.resize(); - } - } - }, - - destroy: function(){ - if(this.tablist){ - this.tablist.destroy(); - } - this.inherited(arguments); - } -}); - -} +//>>built +require({cache:{"url:dijit/layout/templates/TabContainer.html":"<div class=\"dijitTabContainer\">\n\t<div class=\"dijitTabListWrapper\" data-dojo-attach-point=\"tablistNode\"></div>\n\t<div data-dojo-attach-point=\"tablistSpacer\" class=\"dijitTabSpacer ${baseClass}-spacer\"></div>\n\t<div class=\"dijitTabPaneWrapper ${baseClass}-container\" data-dojo-attach-point=\"containerNode\"></div>\n</div>\n"}});define("dijit/layout/_TabContainerBase",["dojo/text!./templates/TabContainer.html","./StackContainer","./utils","../_TemplatedMixin","dojo/_base/declare","dojo/dom-class","dojo/dom-geometry","dojo/dom-style"],function(_1,_2,_3,_4,_5,_6,_7,_8){return _5("dijit.layout._TabContainerBase",[_2,_4],{tabPosition:"top",baseClass:"dijitTabContainer",tabStrip:false,nested:false,templateString:_1,postMixInProperties:function(){this.baseClass+=this.tabPosition.charAt(0).toUpperCase()+this.tabPosition.substr(1).replace(/-.*/,"");this.srcNodeRef&&_8.set(this.srcNodeRef,"visibility","hidden");this.inherited(arguments);},buildRendering:function(){this.inherited(arguments);this.tablist=this._makeController(this.tablistNode);if(!this.doLayout){_6.add(this.domNode,"dijitTabContainerNoLayout");}if(this.nested){_6.add(this.domNode,"dijitTabContainerNested");_6.add(this.tablist.containerNode,"dijitTabContainerTabListNested");_6.add(this.tablistSpacer,"dijitTabContainerSpacerNested");_6.add(this.containerNode,"dijitTabPaneWrapperNested");}else{_6.add(this.domNode,"tabStrip-"+(this.tabStrip?"enabled":"disabled"));}},_setupChild:function(_9){_6.add(_9.domNode,"dijitTabPane");this.inherited(arguments);},startup:function(){if(this._started){return;}this.tablist.startup();this.inherited(arguments);},layout:function(){if(!this._contentBox||typeof (this._contentBox.l)=="undefined"){return;}var sc=this.selectedChildWidget;if(this.doLayout){var _a=this.tabPosition.replace(/-h/,"");this.tablist.layoutAlign=_a;var _b=[this.tablist,{domNode:this.tablistSpacer,layoutAlign:_a},{domNode:this.containerNode,layoutAlign:"client"}];_3.layoutChildren(this.domNode,this._contentBox,_b);this._containerContentBox=_3.marginBox2contentBox(this.containerNode,_b[2]);if(sc&&sc.resize){sc.resize(this._containerContentBox);}}else{if(this.tablist.resize){var s=this.tablist.domNode.style;s.width="0";var _c=_7.getContentBox(this.domNode).w;s.width="";this.tablist.resize({w:_c});}if(sc&&sc.resize){sc.resize();}}},destroy:function(){if(this.tablist){this.tablist.destroy();}this.inherited(arguments);}});});
\ No newline at end of file |