/* 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.TabController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["dijit.layout.TabController"] = true; dojo.provide("dijit.layout.TabController"); dojo.require("dijit.layout.StackController"); dojo.require("dijit.Menu"); dojo.require("dijit.MenuItem"); dojo.requireLocalization("dijit", "common", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"); // Menu is used for an accessible close button, would be nice to have a lighter-weight solution dojo.declare("dijit.layout.TabController", dijit.layout.StackController, { // summary: // Set of tabs (the things with titles and a close button, that you click to show a tab panel). // Used internally by `dijit.layout.TabContainer`. // description: // Lets the user select the currently shown pane in a TabContainer or StackContainer. // TabController also monitors the TabContainer, and whenever a pane is // added or deleted updates itself accordingly. // tags: // private templateString: "
", // tabPosition: String // Defines where tabs go relative to the content. // "top", "bottom", "left-h", "right-h" tabPosition: "top", // buttonWidget: String // The name of the tab widget to create to correspond to each page buttonWidget: "dijit.layout._TabButton", _rectifyRtlTabList: function(){ // summary: // For left/right TabContainer when page is RTL mode, rectify the width of all tabs to be equal, otherwise the tab widths are different in IE if(0 >= this.tabPosition.indexOf('-h')){ return; } if(!this.pane2button){ return; } var maxWidth = 0; for(var pane in this.pane2button){ var ow = this.pane2button[pane].innerDiv.scrollWidth; maxWidth = Math.max(maxWidth, ow); } //unify the length of all the tabs for(pane in this.pane2button){ this.pane2button[pane].innerDiv.style.width = maxWidth + 'px'; } } }); dojo.declare("dijit.layout._TabButton", dijit.layout._StackButton, { // summary: // A tab (the thing you click to select a pane). // description: // Contains the title of the pane, and optionally a close-button to destroy the pane. // This is an internal widget and should not be instantiated directly. // tags: // private // baseClass: String // The CSS class applied to the domNode. baseClass: "dijitTab", // Apply dijitTabCloseButtonHover when close button is hovered cssStateNodes: { closeNode: "dijitTabCloseButton" }, templateString: dojo.cache("dijit.layout", "templates/_TabButton.html", "