dijit/layout/ScrollingTabController.js

  • Provides:

    • dijit.layout.ScrollingTabController
  • dijit.layout.ScrollingTabController

    • type
      Function
    • chains:
      • dijit.layout.TabController: (prototype)
      • dijit.layout.TabController: (call)
    • summary
      Set of tabs with left/right arrow keys and a menu to switch between tabs not
      all fitting on a single row.
      Works only for horizontal tabs (either above or below the content, not to the left
      or right).
      tags:
      private
  • dijit.layout.ScrollingTabController.templateString

    • summary
  • dijit.layout.ScrollingTabController.useMenu

    • tags: const
    • type
      Boolean
    • summary
      True if a menu should be used to select tabs when they are too
      wide to fit the TabContainer, false otherwise.
  • dijit.layout.ScrollingTabController.useSlider

    • tags: const
    • type
      Boolean
    • summary
      True if a slider should be used to select tabs when they are too
      wide to fit the TabContainer, false otherwise.
  • dijit.layout.ScrollingTabController.tabStripClass

    • tags: const
    • type
      String
    • summary
      The css class to apply to the tab strip, if it is visible.
  • dijit.layout.ScrollingTabController.widgetsInTemplate

    • summary
  • dijit.layout.ScrollingTabController._minScroll

    • type
      Number
    • summary
      The distance in pixels from the edge of the tab strip which,
      if a scroll animation is less than, forces the scroll to
      go all the way to the left/right.
  • dijit.layout.ScrollingTabController.attributeMap

    • summary
  • dijit.layout.ScrollingTabController.buildRendering

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        var n = this.domNode;


        this.scrollNode = this.tablistWrapper;
        this._initButtons();


        if(!this.tabStripClass){
         this.tabStripClass = "dijitTabContainer" +
          this.tabPosition.charAt(0).toUpperCase() +
          this.tabPosition.substr(1).replace(/-.*/, "") +
          "None";
         dojo.addClass(n, "tabStrip-disabled")
        }


        dojo.addClass(this.tablistWrapper, this.tabStripClass);
    • summary
  • dijit.layout.ScrollingTabController.onStartup

    • type
      Function
    • source: [view]
        this.inherited(arguments);


        // Do not show the TabController until the related
        // StackController has added it's children. This gives
        // a less visually jumpy instantiation.
        dojo.style(this.domNode, "visibility", "visible");
        this._postStartup = true;
    • summary
  • dijit.layout.ScrollingTabController.onAddChild

    • type
      Function
    • parameters:
      • page: (typeof )
      • insertIndex: (typeof )
    • source: [view]
        this.inherited(arguments);


        // changes to the tab button label or iconClass will have changed the width of the
        // buttons, so do a resize
        dojo.forEach(["label", "iconClass"], function(attr){
         this.pane2watches[page.id].push(
          this.pane2button[page.id].watch(attr, dojo.hitch(this, function(name, oldValue, newValue){
           if(this._postStartup && this._dim){
            this.resize(this._dim);
           }
          }))
         );
        }, this);


        // Increment the width of the wrapper when a tab is added
        // This makes sure that the buttons never wrap.
        // The value 200 is chosen as it should be bigger than most
        // Tab button widths.
        dojo.style(this.containerNode, "width",
         (dojo.style(this.containerNode, "width") + 200) + "px");
    • summary
  • dijit.layout.ScrollingTabController.onRemoveChild

    • type
      Function
    • parameters:
      • page: (typeof )
      • insertIndex: (typeof )
    • source: [view]
      define("dijit/layout/ScrollingTabController", ["dojo", "dijit", "text!dijit/layout/templates/ScrollingTabController.html", "text!dijit/layout/templates/_ScrollingTabControllerButton.html", "dijit/layout/TabController", "dijit/Menu", "dijit/form/Button", "dijit/_HasDropDown"], function(dojo, dijit) {


      dojo.declare("dijit.layout.ScrollingTabController",
       dijit.layout.TabController,
       {
       // summary:
       //  Set of tabs with left/right arrow keys and a menu to switch between tabs not
       //  all fitting on a single row.
       //  Works only for horizontal tabs (either above or below the content, not to the left
       //  or right).
       // tags:
       //  private


       templateString: dojo.cache("dijit.layout", "templates/ScrollingTabController.html"),


       // useMenu: [const] Boolean
       //  True if a menu should be used to select tabs when they are too
       //  wide to fit the TabContainer, false otherwise.
       useMenu: true,


       // useSlider: [const] Boolean
       //  True if a slider should be used to select tabs when they are too
       //  wide to fit the TabContainer, false otherwise.
       useSlider: true,


       // tabStripClass: [const] String
       //  The css class to apply to the tab strip, if it is visible.
       tabStripClass: "",


       widgetsInTemplate: true,


       // _minScroll: Number
       //  The distance in pixels from the edge of the tab strip which,
       //  if a scroll animation is less than, forces the scroll to
       //  go all the way to the left/right.
       _minScroll: 5,


       attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
        "class": "containerNode"
       }),


       buildRendering: function(){
        this.inherited(arguments);
        var n = this.domNode;


        this.scrollNode = this.tablistWrapper;
        this._initButtons();


        if(!this.tabStripClass){
         this.tabStripClass = "dijitTabContainer" +
          this.tabPosition.charAt(0).toUpperCase() +
          this.tabPosition.substr(1).replace(/-.*/, "") +
          "None";
         dojo.addClass(n, "tabStrip-disabled")
        }


        dojo.addClass(this.tablistWrapper, this.tabStripClass);
       },


       onStartup: function(){
        this.inherited(arguments);


        // Do not show the TabController until the related
        // StackController has added it's children. This gives
        // a less visually jumpy instantiation.
        dojo.style(this.domNode, "visibility", "visible");
        this._postStartup = true;
       },


       onAddChild: function(page, insertIndex){
        this.inherited(arguments);


        // changes to the tab button label or iconClass will have changed the width of the
        // buttons, so do a resize
        dojo.forEach(["label", "iconClass"], function(attr){
         this.pane2watches[page.id].push(
          this.pane2button[page.id].watch(attr, dojo.hitch(this, function(name, oldValue, newValue){
           if(this._postStartup && this._dim){
            this.resize(this._dim);
           }
          }))
         );
        }, this);


        // Increment the width of the wrapper when a tab is added
        // This makes sure that the buttons never wrap.
        // The value 200 is chosen as it should be bigger than most
        // Tab button widths.
        dojo.style(this.containerNode, "width",
         (dojo.style(this.containerNode, "width") + 200) + "px");
       },


       onRemoveChild: function(page, insertIndex){
        // null out _selectedTab because we are about to delete that dom node
        var button = this.pane2button[page.id];
        if(this._selectedTab === button.domNode){
         this._selectedTab = null;
        }


        this.inherited(arguments);
    • summary
  • dijit.layout.ScrollingTabController._initButtons

    • type
      Function
    • source: [view]
      define("dijit/layout/ScrollingTabController", ["dojo", "dijit", "text!dijit/layout/templates/ScrollingTabController.html", "text!dijit/layout/templates/_ScrollingTabControllerButton.html", "dijit/layout/TabController", "dijit/Menu", "dijit/form/Button", "dijit/_HasDropDown"], function(dojo, dijit) {


      dojo.declare("dijit.layout.ScrollingTabController",
       dijit.layout.TabController,
       {
       // summary:
       //  Set of tabs with left/right arrow keys and a menu to switch between tabs not
       //  all fitting on a single row.
       //  Works only for horizontal tabs (either above or below the content, not to the left
       //  or right).
       // tags:
       //  private


       templateString: dojo.cache("dijit.layout", "templates/ScrollingTabController.html"),


       // useMenu: [const] Boolean
       //  True if a menu should be used to select tabs when they are too
       //  wide to fit the TabContainer, false otherwise.
       useMenu: true,


       // useSlider: [const] Boolean
       //  True if a slider should be used to select tabs when they are too
       //  wide to fit the TabContainer, false otherwise.
       useSlider: true,


       // tabStripClass: [const] String
       //  The css class to apply to the tab strip, if it is visible.
       tabStripClass: "",


       widgetsInTemplate: true,


       // _minScroll: Number
       //  The distance in pixels from the edge of the tab strip which,
       //  if a scroll animation is less than, forces the scroll to
       //  go all the way to the left/right.
       _minScroll: 5,


       attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
        "class": "containerNode"
       }),


       buildRendering: function(){
        this.inherited(arguments);
        var n = this.domNode;


        this.scrollNode = this.tablistWrapper;
        this._initButtons();


        if(!this.tabStripClass){
         this.tabStripClass = "dijitTabContainer" +
          this.tabPosition.charAt(0).toUpperCase() +
          this.tabPosition.substr(1).replace(/-.*/, "") +
          "None";
         dojo.addClass(n, "tabStrip-disabled")
        }


        dojo.addClass(this.tablistWrapper, this.tabStripClass);
       },


       onStartup: function(){
        this.inherited(arguments);


        // Do not show the TabController until the related
        // StackController has added it's children. This gives
        // a less visually jumpy instantiation.
        dojo.style(this.domNode, "visibility", "visible");
        this._postStartup = true;
       },


       onAddChild: function(page, insertIndex){
        this.inherited(arguments);


        // changes to the tab button label or iconClass will have changed the width of the
        // buttons, so do a resize
        dojo.forEach(["label", "iconClass"], function(attr){
         this.pane2watches[page.id].push(
          this.pane2button[page.id].watch(attr, dojo.hitch(this, function(name, oldValue, newValue){
           if(this._postStartup && this._dim){
            this.resize(this._dim);
           }
          }))
         );
        }, this);


        // Increment the width of the wrapper when a tab is added
        // This makes sure that the buttons never wrap.
        // The value 200 is chosen as it should be bigger than most
        // Tab button widths.
        dojo.style(this.containerNode, "width",
         (dojo.style(this.containerNode, "width") + 200) + "px");
       },


       onRemoveChild: function(page, insertIndex){
        // null out _selectedTab because we are about to delete that dom node
        var button = this.pane2button[page.id];
        if(this._selectedTab === button.domNode){
         this._selectedTab = null;
        }


        this.inherited(arguments);
       },


       _initButtons: function(){
        // summary:
        //  Creates the buttons used to scroll to view tabs that
        //  may not be visible if the TabContainer is too narrow.


        // Make a list of the buttons to display when the tab labels become
        // wider than the TabContainer, and hide the other buttons.
        // Also gets the total width of the displayed buttons.
        this._btnWidth = 0;
        this._buttons = dojo.query("> .tabStripButton", this.domNode).filter(function(btn){
         if((this.useMenu && btn == this._menuBtn.domNode) ||
          (this.useSlider && (btn == this._rightBtn.domNode || btn == this._leftBtn.domNode))){
          this._btnWidth += dojo._getMarginSize(btn).w;
          return true;
         }else{
          dojo.style(btn, "display", "none");
          return false;
         }
        }, this);
    • summary
  • dijit.layout.ScrollingTabController._getTabsWidth

    • type
      Function
    • source: [view]
        var children = this.getChildren();
        if(children.length){
         var leftTab = children[this.isLeftToRight() ? 0 : children.length - 1].domNode,
          rightTab = children[this.isLeftToRight() ? children.length - 1 : 0].domNode;
         return rightTab.offsetLeft + dojo.style(rightTab, "width") - leftTab.offsetLeft;
        }else{
         return 0;
        }
    • summary
  • dijit.layout.ScrollingTabController._enableBtn

    • type
      Function
    • parameters:
      • width: (typeof )
    • source: [view]
        var tabsWidth = this._getTabsWidth();
        width = width || dojo.style(this.scrollNode, "width");
        return tabsWidth > 0 && width < tabsWidth;
    • summary
      Determines if the tabs are wider than the width of the TabContainer, and
      thus that we need to display left/right/menu navigation buttons.
  • dijit.layout.ScrollingTabController.resize

    • type
      Function
    • parameters:
      • dim: (typeof )
    • source: [view]
        if(this.domNode.offsetWidth == 0){
         return;
        }


        // Save the dimensions to be used when a child is renamed.
        this._dim = dim;


        // Set my height to be my natural height (tall enough for one row of tab labels),
        // and my content-box width based on margin-box width specified in dim parameter.
        // But first reset scrollNode.height in case it was set by layoutChildren() call
        // in a previous run of this method.
        this.scrollNode.style.height = "auto";
        this._contentBox = dijit.layout.marginBox2contentBox(this.domNode, {h: 0, w: dim.w});
        this._contentBox.h = this.scrollNode.offsetHeight;
        dojo.contentBox(this.domNode, this._contentBox);


        // Show/hide the left/right/menu navigation buttons depending on whether or not they
        // are needed.
        var enable = this._enableBtn(this._contentBox.w);
        this._buttons.style("display", enable ? "" : "none");


        // Position and size the navigation buttons and the tablist
        this._leftBtn.layoutAlign = "left";
        this._rightBtn.layoutAlign = "right";
        this._menuBtn.layoutAlign = this.isLeftToRight() ? "right" : "left";
        dijit.layout.layoutChildren(this.domNode, this._contentBox,
         [this._menuBtn, this._leftBtn, this._rightBtn, {domNode: this.scrollNode, layoutAlign: "client"}]);


        // set proper scroll so that selected tab is visible
        if(this._selectedTab){
         if(this._anim && this._anim.status() == "playing"){
          this._anim.stop();
         }
         var w = this.scrollNode,
          sl = this._convertToScrollLeft(this._getScrollForSelectedTab());
         w.scrollLeft = sl;
        }


        // Enable/disabled left right buttons depending on whether or not user can scroll to left or right
        this._setButtonClass(this._getScroll());

        
        this._postResize = true;


        // Return my size so layoutChildren() can use it.
        // Also avoids IE9 layout glitch on browser resize when scroll buttons present
        return {h: this._contentBox.h, w: dim.w};
    • summary
      Hides or displays the buttons used to scroll the tab list and launch the menu
      that selects tabs.
  • dijit.layout.ScrollingTabController._getScroll

    • type
      Function
    • source: [view]
        var sl = (this.isLeftToRight() || dojo.isIE < 8 || (dojo.isIE && dojo.isQuirks) || dojo.isWebKit) ? this.scrollNode.scrollLeft :
          dojo.style(this.containerNode, "width") - dojo.style(this.scrollNode, "width")
            + (dojo.isIE == 8 ? -1 : 1) * this.scrollNode.scrollLeft;
        return sl;
    • summary
      Returns the current scroll of the tabs where 0 means
      &quot;scrolled all the way to the left&quot; and some positive number, based on #
      of pixels of possible scroll (ex: 1000) means &quot;scrolled all the way to the right&quot;
  • dijit.layout.ScrollingTabController._convertToScrollLeft

    • type
      Function
    • parameters:
      • val: (typeof )
    • source: [view]
        if(this.isLeftToRight() || dojo.isIE < 8 || (dojo.isIE && dojo.isQuirks) || dojo.isWebKit){
         return val;
        }else{
         var maxScroll = dojo.style(this.containerNode, "width") - dojo.style(this.scrollNode, "width");
         return (dojo.isIE == 8 ? -1 : 1) * (val - maxScroll);
        }
    • summary
      Given a scroll value where 0 means &quot;scrolled all the way to the left&quot;
      and some positive number, based on # of pixels of possible scroll (ex: 1000)
      means &quot;scrolled all the way to the right&quot;, return value to set this.scrollNode.scrollLeft
      to achieve that scroll.
      
      This method is to adjust for RTL funniness in various browsers and versions.
  • dijit.layout.ScrollingTabController.onSelectChild

    • type
      Function
    • parameters:
      • page: (typeof dijit._Widget)
    • source: [view]
        var tab = this.pane2button[page.id];
        if(!tab || !page){return;}


        // Scroll to the selected tab, except on startup, when scrolling is handled in resize()
        var node = tab.domNode;
        if(this._postResize && node != this._selectedTab){
         this._selectedTab = node;


         var sl = this._getScroll();


         if(sl > node.offsetLeft ||
           sl + dojo.style(this.scrollNode, "width") <
           node.offsetLeft + dojo.style(node, "width")){
          this.createSmoothScroll().play();
         }
        }


        this.inherited(arguments);
    • summary
      Smoothly scrolls to a tab when it is selected.
  • dijit.layout.ScrollingTabController._getScrollBounds

    • type
      Function
    • source: [view]
        var children = this.getChildren(),
         scrollNodeWidth = dojo.style(this.scrollNode, "width"),  // about 500px
         containerWidth = dojo.style(this.containerNode, "width"), // 50,000px
         maxPossibleScroll = containerWidth - scrollNodeWidth, // scrolling until right edge of containerNode visible
         tabsWidth = this._getTabsWidth();


        if(children.length && tabsWidth > scrollNodeWidth){
         // Scrolling should happen
         return {
          min: this.isLeftToRight() ? 0 : children[children.length-1].domNode.offsetLeft,
          max: this.isLeftToRight() ?
           (children[children.length-1].domNode.offsetLeft + dojo.style(children[children.length-1].domNode, "width")) - scrollNodeWidth :
           maxPossibleScroll
         };
        }else{
         // No scrolling needed, all tabs visible, we stay either scrolled to far left or far right (depending on dir)
         var onlyScrollPosition = this.isLeftToRight() ? 0 : maxPossibleScroll;
         return {
          min: onlyScrollPosition,
          max: onlyScrollPosition
         };
        }
    • summary
      Returns the minimum and maximum scroll setting to show the leftmost and rightmost
      tabs (respectively)
  • dijit.layout.ScrollingTabController._getScrollForSelectedTab

    • type
      Function
    • source: [view]
        var w = this.scrollNode,
         n = this._selectedTab,
         scrollNodeWidth = dojo.style(this.scrollNode, "width"),
         scrollBounds = this._getScrollBounds();


        // TODO: scroll minimal amount (to either right or left) so that
        // selected tab is fully visible, and just return if it's already visible?
        var pos = (n.offsetLeft + dojo.style(n, "width")/2) - scrollNodeWidth/2;
        pos = Math.min(Math.max(pos, scrollBounds.min), scrollBounds.max);


        // TODO:
        // If scrolling close to the left side or right side, scroll
        // all the way to the left or right. See this._minScroll.
        // (But need to make sure that doesn't scroll the tab out of view...)
        return pos;
    • summary
      Returns the scroll value setting so that the selected tab
      will appear in the center
  • dijit.layout.ScrollingTabController.createSmoothScroll

    • type
      Function
    • parameters:
      • x: (typeof )
    • source: [view]
      define("dijit/layout/ScrollingTabController", ["dojo", "dijit", "text!dijit/layout/templates/ScrollingTabController.html", "text!dijit/layout/templates/_ScrollingTabControllerButton.html", "dijit/layout/TabController", "dijit/Menu", "dijit/form/Button", "dijit/_HasDropDown"], function(dojo, dijit) {


      dojo.declare("dijit.layout.ScrollingTabController",
       dijit.layout.TabController,
       {
       // summary:
       //  Set of tabs with left/right arrow keys and a menu to switch between tabs not
       //  all fitting on a single row.
       //  Works only for horizontal tabs (either above or below the content, not to the left
       //  or right).
       // tags:
       //  private


       templateString: dojo.cache("dijit.layout", "templates/ScrollingTabController.html"),


       // useMenu: [const] Boolean
       //  True if a menu should be used to select tabs when they are too
       //  wide to fit the TabContainer, false otherwise.
       useMenu: true,


       // useSlider: [const] Boolean
       //  True if a slider should be used to select tabs when they are too
       //  wide to fit the TabContainer, false otherwise.
       useSlider: true,


       // tabStripClass: [const] String
       //  The css class to apply to the tab strip, if it is visible.
       tabStripClass: "",


       widgetsInTemplate: true,


       // _minScroll: Number
       //  The distance in pixels from the edge of the tab strip which,
       //  if a scroll animation is less than, forces the scroll to
       //  go all the way to the left/right.
       _minScroll: 5,


       attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
        "class": "containerNode"
       }),


       buildRendering: function(){
        this.inherited(arguments);
        var n = this.domNode;


        this.scrollNode = this.tablistWrapper;
        this._initButtons();


        if(!this.tabStripClass){
         this.tabStripClass = "dijitTabContainer" +
          this.tabPosition.charAt(0).toUpperCase() +
          this.tabPosition.substr(1).replace(/-.*/, "") +
          "None";
         dojo.addClass(n, "tabStrip-disabled")
        }


        dojo.addClass(this.tablistWrapper, this.tabStripClass);
       },


       onStartup: function(){
        this.inherited(arguments);


        // Do not show the TabController until the related
        // StackController has added it's children. This gives
        // a less visually jumpy instantiation.
        dojo.style(this.domNode, "visibility", "visible");
        this._postStartup = true;
       },


       onAddChild: function(page, insertIndex){
        this.inherited(arguments);


        // changes to the tab button label or iconClass will have changed the width of the
        // buttons, so do a resize
        dojo.forEach(["label", "iconClass"], function(attr){
         this.pane2watches[page.id].push(
          this.pane2button[page.id].watch(attr, dojo.hitch(this, function(name, oldValue, newValue){
           if(this._postStartup && this._dim){
            this.resize(this._dim);
           }
          }))
         );
        }, this);


        // Increment the width of the wrapper when a tab is added
        // This makes sure that the buttons never wrap.
        // The value 200 is chosen as it should be bigger than most
        // Tab button widths.
        dojo.style(this.containerNode, "width",
         (dojo.style(this.containerNode, "width") + 200) + "px");
       },


       onRemoveChild: function(page, insertIndex){
        // null out _selectedTab because we are about to delete that dom node
        var button = this.pane2button[page.id];
        if(this._selectedTab === button.domNode){
         this._selectedTab = null;
        }


        this.inherited(arguments);
       },


       _initButtons: function(){
        // summary:
        //  Creates the buttons used to scroll to view tabs that
        //  may not be visible if the TabContainer is too narrow.


        // Make a list of the buttons to display when the tab labels become
        // wider than the TabContainer, and hide the other buttons.
        // Also gets the total width of the displayed buttons.
        this._btnWidth = 0;
        this._buttons = dojo.query("> .tabStripButton", this.domNode).filter(function(btn){
         if((this.useMenu && btn == this._menuBtn.domNode) ||
          (this.useSlider && (btn == this._rightBtn.domNode || btn == this._leftBtn.domNode))){
          this._btnWidth += dojo._getMarginSize(btn).w;
          return true;
         }else{
          dojo.style(btn, "display", "none");
          return false;
         }
        }, this);
       },


       _getTabsWidth: function(){
        var children = this.getChildren();
        if(children.length){
         var leftTab = children[this.isLeftToRight() ? 0 : children.length - 1].domNode,
          rightTab = children[this.isLeftToRight() ? children.length - 1 : 0].domNode;
         return rightTab.offsetLeft + dojo.style(rightTab, "width") - leftTab.offsetLeft;
        }else{
         return 0;
        }
       },


       _enableBtn: function(width){
        // summary:
        //  Determines if the tabs are wider than the width of the TabContainer, and
        //  thus that we need to display left/right/menu navigation buttons.
        var tabsWidth = this._getTabsWidth();
        width = width || dojo.style(this.scrollNode, "width");
        return tabsWidth > 0 && width < tabsWidth;
       },


       resize: function(dim){
        // summary:
        //  Hides or displays the buttons used to scroll the tab list and launch the menu
        //  that selects tabs.


        if(this.domNode.offsetWidth == 0){
         return;
        }


        // Save the dimensions to be used when a child is renamed.
        this._dim = dim;


        // Set my height to be my natural height (tall enough for one row of tab labels),
        // and my content-box width based on margin-box width specified in dim parameter.
        // But first reset scrollNode.height in case it was set by layoutChildren() call
        // in a previous run of this method.
        this.scrollNode.style.height = "auto";
        this._contentBox = dijit.layout.marginBox2contentBox(this.domNode, {h: 0, w: dim.w});
        this._contentBox.h = this.scrollNode.offsetHeight;
        dojo.contentBox(this.domNode, this._contentBox);


        // Show/hide the left/right/menu navigation buttons depending on whether or not they
        // are needed.
        var enable = this._enableBtn(this._contentBox.w);
        this._buttons.style("display", enable ? "" : "none");


        // Position and size the navigation buttons and the tablist
        this._leftBtn.layoutAlign = "left";
        this._rightBtn.layoutAlign = "right";
        this._menuBtn.layoutAlign = this.isLeftToRight() ? "right" : "left";
        dijit.layout.layoutChildren(this.domNode, this._contentBox,
         [this._menuBtn, this._leftBtn, this._rightBtn, {domNode: this.scrollNode, layoutAlign: "client"}]);


        // set proper scroll so that selected tab is visible
        if(this._selectedTab){
         if(this._anim && this._anim.status() == "playing"){
          this._anim.stop();
         }
         var w = this.scrollNode,
          sl = this._convertToScrollLeft(this._getScrollForSelectedTab());
         w.scrollLeft = sl;
        }


        // Enable/disabled left right buttons depending on whether or not user can scroll to left or right
        this._setButtonClass(this._getScroll());

        
        this._postResize = true;


        // Return my size so layoutChildren() can use it.
        // Also avoids IE9 layout glitch on browser resize when scroll buttons present
        return {h: this._contentBox.h, w: dim.w};
       },


       _getScroll: function(){
        // summary:
        //  Returns the current scroll of the tabs where 0 means
        //  "scrolled all the way to the left" and some positive number, based on #
        //  of pixels of possible scroll (ex: 1000) means "scrolled all the way to the right"
        var sl = (this.isLeftToRight() || dojo.isIE < 8 || (dojo.isIE && dojo.isQuirks) || dojo.isWebKit) ? this.scrollNode.scrollLeft :
          dojo.style(this.containerNode, "width") - dojo.style(this.scrollNode, "width")
            + (dojo.isIE == 8 ? -1 : 1) * this.scrollNode.scrollLeft;
        return sl;
       },


       _convertToScrollLeft: function(val){
        // summary:
        //  Given a scroll value where 0 means "scrolled all the way to the left"
        //  and some positive number, based on # of pixels of possible scroll (ex: 1000)
        //  means "scrolled all the way to the right", return value to set this.scrollNode.scrollLeft
        //  to achieve that scroll.
        //
        //  This method is to adjust for RTL funniness in various browsers and versions.
        if(this.isLeftToRight() || dojo.isIE < 8 || (dojo.isIE && dojo.isQuirks) || dojo.isWebKit){
         return val;
        }else{
         var maxScroll = dojo.style(this.containerNode, "width") - dojo.style(this.scrollNode, "width");
         return (dojo.isIE == 8 ? -1 : 1) * (val - maxScroll);
        }
       },


       onSelectChild: function(/*dijit._Widget*/ page){
        // summary:
        //  Smoothly scrolls to a tab when it is selected.


        var tab = this.pane2button[page.id];
        if(!tab || !page){return;}


        // Scroll to the selected tab, except on startup, when scrolling is handled in resize()
        var node = tab.domNode;
        if(this._postResize && node != this._selectedTab){
         this._selectedTab = node;


         var sl = this._getScroll();


         if(sl > node.offsetLeft ||
           sl + dojo.style(this.scrollNode, "width") <
           node.offsetLeft + dojo.style(node, "width")){
          this.createSmoothScroll().play();
         }
        }


        this.inherited(arguments);
       },


       _getScrollBounds: function(){
        // summary:
        //  Returns the minimum and maximum scroll setting to show the leftmost and rightmost
        //  tabs (respectively)
        var children = this.getChildren(),
         scrollNodeWidth = dojo.style(this.scrollNode, "width"),  // about 500px
         containerWidth = dojo.style(this.containerNode, "width"), // 50,000px
         maxPossibleScroll = containerWidth - scrollNodeWidth, // scrolling until right edge of containerNode visible
         tabsWidth = this._getTabsWidth();


        if(children.length && tabsWidth > scrollNodeWidth){
         // Scrolling should happen
         return {
          min: this.isLeftToRight() ? 0 : children[children.length-1].domNode.offsetLeft,
          max: this.isLeftToRight() ?
           (children[children.length-1].domNode.offsetLeft + dojo.style(children[children.length-1].domNode, "width")) - scrollNodeWidth :
           maxPossibleScroll
         };
        }else{
         // No scrolling needed, all tabs visible, we stay either scrolled to far left or far right (depending on dir)
         var onlyScrollPosition = this.isLeftToRight() ? 0 : maxPossibleScroll;
         return {
          min: onlyScrollPosition,
          max: onlyScrollPosition
         };
        }
       },


       _getScrollForSelectedTab: function(){
        // summary:
        //  Returns the scroll value setting so that the selected tab
        //  will appear in the center
        var w = this.scrollNode,
         n = this._selectedTab,
         scrollNodeWidth = dojo.style(this.scrollNode, "width"),
         scrollBounds = this._getScrollBounds();


        // TODO: scroll minimal amount (to either right or left) so that
        // selected tab is fully visible, and just return if it's already visible?
        var pos = (n.offsetLeft + dojo.style(n, "width")/2) - scrollNodeWidth/2;
        pos = Math.min(Math.max(pos, scrollBounds.min), scrollBounds.max);


        // TODO:
        // If scrolling close to the left side or right side, scroll
        // all the way to the left or right. See this._minScroll.
        // (But need to make sure that doesn't scroll the tab out of view...)
        return pos;
       },


       createSmoothScroll: function(x){
        // summary:
        //  Creates a dojo._Animation object that smoothly scrolls the tab list
        //  either to a fixed horizontal pixel value, or to the selected tab.
        // description:
        //  If an number argument is passed to the function, that horizontal
        //  pixel position is scrolled to. Otherwise the currently selected
        //  tab is scrolled to.
        // x: Integer?
        //  An optional pixel value to scroll to, indicating distance from left.


        // Calculate position to scroll to
        if(arguments.length > 0){
         // position specified by caller, just make sure it's within bounds
         var scrollBounds = this._getScrollBounds();
         x = Math.min(Math.max(x, scrollBounds.min), scrollBounds.max);
        }else{
         // scroll to center the current tab
         x = this._getScrollForSelectedTab();
        }


        if(this._anim && this._anim.status() == "playing"){
         this._anim.stop();
        }


        var self = this,
         w = this.scrollNode,
         anim = new dojo._Animation({
          beforeBegin: function(){
           if(this.curve){ delete this.curve; }
           var oldS = w.scrollLeft,
            newS = self._convertToScrollLeft(x);
           anim.curve = new dojo._Line(oldS, newS);
          },
          onAnimate: function(val){
           w.scrollLeft = val;
          }
         });
        this._anim = anim;


        // Disable/enable left/right buttons according to new scroll position
        this._setButtonClass(x);


        return anim; // dojo._Animation
    • summary
      Creates a dojo._Animation object that smoothly scrolls the tab list
      either to a fixed horizontal pixel value, or to the selected tab.
    • description
      If an number argument is passed to the function, that horizontal
      pixel position is scrolled to.  Otherwise the currently selected
      tab is scrolled to.
    • returns
      dojo._Animation
  • dijit.layout.ScrollingTabController._getBtnNode

    • type
      Function
    • parameters:
      • e: (typeof Event)
        The mouse click event.
    • source: [view]
        var n = e.target;
        while(n && !dojo.hasClass(n, "tabStripButton")){
         n = n.parentNode;
        }
        return n;
    • summary
      Gets a button DOM node from a mouse click event.
  • dijit.layout.ScrollingTabController.doSlideRight

    • type
      Function
    • parameters:
      • e: (typeof Event)
        The mouse click event.
    • source: [view]
        this.doSlide(1, this._getBtnNode(e));
    • summary
      Scrolls the menu to the right.
  • dijit.layout.ScrollingTabController.doSlideLeft

    • type
      Function
    • parameters:
      • e: (typeof Event)
        The mouse click event.
    • source: [view]
        this.doSlide(-1,this._getBtnNode(e));
    • summary
      Scrolls the menu to the left.
  • dijit.layout.ScrollingTabController.doSlide

    • type
      Function
    • parameters:
      • direction: (typeof Number)
        If the direction is 1, the widget scrolls to the right, if it is
        -1, it scrolls to the left.
      • node: (typeof DomNode)
    • source: [view]
        if(node && dojo.hasClass(node, "dijitTabDisabled")){return;}


        var sWidth = dojo.style(this.scrollNode, "width");
        var d = (sWidth * 0.75) * direction;


        var to = this._getScroll() + d;


        this._setButtonClass(to);


        this.createSmoothScroll(to).play();
    • summary
      Scrolls the tab list to the left or right by 75% of the widget width.
  • dijit.layout.ScrollingTabController._setButtonClass

    • type
      Function
    • parameters:
      • scroll: (typeof Number)
        Integer
        amount of horizontal scroll
    • source: [view]
        var scrollBounds = this._getScrollBounds();
        this._leftBtn.set("disabled", scroll <= scrollBounds.min);
        this._rightBtn.set("disabled", scroll >= scrollBounds.max);
    • summary
      Disables the left scroll button if the tabs are scrolled all the way to the left,
      or the right scroll button in the opposite case.
  • dijit.layout.ScrollingTabController.scrollNode

    • summary
  • dijit.layout.ScrollingTabController._postStartup

    • summary
  • dijit.layout.ScrollingTabController._selectedTab

    • summary
  • dijit.layout.ScrollingTabController._btnWidth

    • summary
  • dijit.layout.ScrollingTabController._buttons

    • summary
  • dijit.layout.ScrollingTabController.domNode.offsetWidth

    • summary
  • dijit.layout.ScrollingTabController._dim

    • summary
  • dijit.layout.ScrollingTabController.scrollNode.style.height

    • summary
  • dijit.layout.ScrollingTabController._contentBox

    • summary
  • dijit.layout.ScrollingTabController._contentBox.h

    • summary
  • dijit.layout.ScrollingTabController._leftBtn.layoutAlign

    • summary
  • dijit.layout.ScrollingTabController._rightBtn.layoutAlign

    • summary
  • dijit.layout.ScrollingTabController._menuBtn.layoutAlign

    • summary
  • dijit.layout.ScrollingTabController._postResize

    • summary
  • dijit.layout.ScrollingTabController._anim

    • summary
  • dijit.layout._ScrollingTabControllerButtonMixin

    • type
      Function
    • summary
  • dijit.layout._ScrollingTabControllerButtonMixin.baseClass

    • summary
  • dijit.layout._ScrollingTabControllerButtonMixin.templateString

    • summary
  • dijit.layout._ScrollingTabControllerButtonMixin.tabIndex

    • summary
  • dijit.layout._ScrollingTabControllerButtonMixin.isFocusable

    • type
      Function
    • source: [view]
       isFocusable: function(){ return false;
    • summary
  • dijit.layout._ScrollingTabControllerButton

    • type
      Function
    • chains:
      • dijit.form.Button: (prototype)
      • dijit.form.Button: (call)
      • dijit.layout._ScrollingTabControllerButtonMixin: (call)
    • mixins:
      • dijit.layout._ScrollingTabControllerButtonMixin.prototype: (prototype)
    • summary
  • dijit.layout._ScrollingTabControllerMenuButton

    • type
      Function
    • chains:
      • dijit.form.Button: (prototype)
      • dijit.form.Button: (call)
      • dijit._HasDropDown: (call)
      • dijit.layout._ScrollingTabControllerButtonMixin: (call)
    • mixins:
      • dijit._HasDropDown.prototype: (prototype)
      • dijit.layout._ScrollingTabControllerButtonMixin.prototype: (prototype)
    • summary
  • dijit.layout._ScrollingTabControllerMenuButton.containerId

    • summary
  • dijit.layout._ScrollingTabControllerMenuButton.tabIndex

    • summary
  • dijit.layout._ScrollingTabControllerMenuButton.isLoaded

    • type
      Function
    • source: [view]
      define("dijit/layout/ScrollingTabController", ["dojo", "dijit", "text!dijit/layout/templates/ScrollingTabController.html", "text!dijit/layout/templates/_ScrollingTabControllerButton.html", "dijit/layout/TabController", "dijit/Menu", "dijit/form/Button", "dijit/_HasDropDown"], function(dojo, dijit) {


      dojo.declare("dijit.layout.ScrollingTabController",
       dijit.layout.TabController,
       {
       // summary:
       //  Set of tabs with left/right arrow keys and a menu to switch between tabs not
       //  all fitting on a single row.
       //  Works only for horizontal tabs (either above or below the content, not to the left
       //  or right).
       // tags:
       //  private


       templateString: dojo.cache("dijit.layout", "templates/ScrollingTabController.html"),


       // useMenu: [const] Boolean
       //  True if a menu should be used to select tabs when they are too
       //  wide to fit the TabContainer, false otherwise.
       useMenu: true,


       // useSlider: [const] Boolean
       //  True if a slider should be used to select tabs when they are too
       //  wide to fit the TabContainer, false otherwise.
       useSlider: true,


       // tabStripClass: [const] String
       //  The css class to apply to the tab strip, if it is visible.
       tabStripClass: "",


       widgetsInTemplate: true,


       // _minScroll: Number
       //  The distance in pixels from the edge of the tab strip which,
       //  if a scroll animation is less than, forces the scroll to
       //  go all the way to the left/right.
       _minScroll: 5,


       attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
        "class": "containerNode"
       }),


       buildRendering: function(){
        this.inherited(arguments);
        var n = this.domNode;


        this.scrollNode = this.tablistWrapper;
        this._initButtons();


        if(!this.tabStripClass){
         this.tabStripClass = "dijitTabContainer" +
          this.tabPosition.charAt(0).toUpperCase() +
          this.tabPosition.substr(1).replace(/-.*/, "") +
          "None";
         dojo.addClass(n, "tabStrip-disabled")
        }


        dojo.addClass(this.tablistWrapper, this.tabStripClass);
       },


       onStartup: function(){
        this.inherited(arguments);


        // Do not show the TabController until the related
        // StackController has added it's children. This gives
        // a less visually jumpy instantiation.
        dojo.style(this.domNode, "visibility", "visible");
        this._postStartup = true;
       },


       onAddChild: function(page, insertIndex){
        this.inherited(arguments);


        // changes to the tab button label or iconClass will have changed the width of the
        // buttons, so do a resize
        dojo.forEach(["label", "iconClass"], function(attr){
         this.pane2watches[page.id].push(
          this.pane2button[page.id].watch(attr, dojo.hitch(this, function(name, oldValue, newValue){
           if(this._postStartup && this._dim){
            this.resize(this._dim);
           }
          }))
         );
        }, this);


        // Increment the width of the wrapper when a tab is added
        // This makes sure that the buttons never wrap.
        // The value 200 is chosen as it should be bigger than most
        // Tab button widths.
        dojo.style(this.containerNode, "width",
         (dojo.style(this.containerNode, "width") + 200) + "px");
       },


       onRemoveChild: function(page, insertIndex){
        // null out _selectedTab because we are about to delete that dom node
        var button = this.pane2button[page.id];
        if(this._selectedTab === button.domNode){
         this._selectedTab = null;
        }


        this.inherited(arguments);
       },


       _initButtons: function(){
        // summary:
        //  Creates the buttons used to scroll to view tabs that
        //  may not be visible if the TabContainer is too narrow.


        // Make a list of the buttons to display when the tab labels become
        // wider than the TabContainer, and hide the other buttons.
        // Also gets the total width of the displayed buttons.
        this._btnWidth = 0;
        this._buttons = dojo.query("> .tabStripButton", this.domNode).filter(function(btn){
         if((this.useMenu && btn == this._menuBtn.domNode) ||
          (this.useSlider && (btn == this._rightBtn.domNode || btn == this._leftBtn.domNode))){
          this._btnWidth += dojo._getMarginSize(btn).w;
          return true;
         }else{
          dojo.style(btn, "display", "none");
          return false;
         }
        }, this);
       },


       _getTabsWidth: function(){
        var children = this.getChildren();
        if(children.length){
         var leftTab = children[this.isLeftToRight() ? 0 : children.length - 1].domNode,
          rightTab = children[this.isLeftToRight() ? children.length - 1 : 0].domNode;
         return rightTab.offsetLeft + dojo.style(rightTab, "width") - leftTab.offsetLeft;
        }else{
         return 0;
        }
       },


       _enableBtn: function(width){
        // summary:
        //  Determines if the tabs are wider than the width of the TabContainer, and
        //  thus that we need to display left/right/menu navigation buttons.
        var tabsWidth = this._getTabsWidth();
        width = width || dojo.style(this.scrollNode, "width");
        return tabsWidth > 0 && width < tabsWidth;
       },


       resize: function(dim){
        // summary:
        //  Hides or displays the buttons used to scroll the tab list and launch the menu
        //  that selects tabs.


        if(this.domNode.offsetWidth == 0){
         return;
        }


        // Save the dimensions to be used when a child is renamed.
        this._dim = dim;


        // Set my height to be my natural height (tall enough for one row of tab labels),
        // and my content-box width based on margin-box width specified in dim parameter.
        // But first reset scrollNode.height in case it was set by layoutChildren() call
        // in a previous run of this method.
        this.scrollNode.style.height = "auto";
        this._contentBox = dijit.layout.marginBox2contentBox(this.domNode, {h: 0, w: dim.w});
        this._contentBox.h = this.scrollNode.offsetHeight;
        dojo.contentBox(this.domNode, this._contentBox);


        // Show/hide the left/right/menu navigation buttons depending on whether or not they
        // are needed.
        var enable = this._enableBtn(this._contentBox.w);
        this._buttons.style("display", enable ? "" : "none");


        // Position and size the navigation buttons and the tablist
        this._leftBtn.layoutAlign = "left";
        this._rightBtn.layoutAlign = "right";
        this._menuBtn.layoutAlign = this.isLeftToRight() ? "right" : "left";
        dijit.layout.layoutChildren(this.domNode, this._contentBox,
         [this._menuBtn, this._leftBtn, this._rightBtn, {domNode: this.scrollNode, layoutAlign: "client"}]);


        // set proper scroll so that selected tab is visible
        if(this._selectedTab){
         if(this._anim && this._anim.status() == "playing"){
          this._anim.stop();
         }
         var w = this.scrollNode,
          sl = this._convertToScrollLeft(this._getScrollForSelectedTab());
         w.scrollLeft = sl;
        }


        // Enable/disabled left right buttons depending on whether or not user can scroll to left or right
        this._setButtonClass(this._getScroll());

        
        this._postResize = true;


        // Return my size so layoutChildren() can use it.
        // Also avoids IE9 layout glitch on browser resize when scroll buttons present
        return {h: this._contentBox.h, w: dim.w};
       },


       _getScroll: function(){
        // summary:
        //  Returns the current scroll of the tabs where 0 means
        //  "scrolled all the way to the left" and some positive number, based on #
        //  of pixels of possible scroll (ex: 1000) means "scrolled all the way to the right"
        var sl = (this.isLeftToRight() || dojo.isIE < 8 || (dojo.isIE && dojo.isQuirks) || dojo.isWebKit) ? this.scrollNode.scrollLeft :
          dojo.style(this.containerNode, "width") - dojo.style(this.scrollNode, "width")
            + (dojo.isIE == 8 ? -1 : 1) * this.scrollNode.scrollLeft;
        return sl;
       },


       _convertToScrollLeft: function(val){
        // summary:
        //  Given a scroll value where 0 means "scrolled all the way to the left"
        //  and some positive number, based on # of pixels of possible scroll (ex: 1000)
        //  means "scrolled all the way to the right", return value to set this.scrollNode.scrollLeft
        //  to achieve that scroll.
        //
        //  This method is to adjust for RTL funniness in various browsers and versions.
        if(this.isLeftToRight() || dojo.isIE < 8 || (dojo.isIE && dojo.isQuirks) || dojo.isWebKit){
         return val;
        }else{
         var maxScroll = dojo.style(this.containerNode, "width") - dojo.style(this.scrollNode, "width");
         return (dojo.isIE == 8 ? -1 : 1) * (val - maxScroll);
        }
       },


       onSelectChild: function(/*dijit._Widget*/ page){
        // summary:
        //  Smoothly scrolls to a tab when it is selected.


        var tab = this.pane2button[page.id];
        if(!tab || !page){return;}


        // Scroll to the selected tab, except on startup, when scrolling is handled in resize()
        var node = tab.domNode;
        if(this._postResize && node != this._selectedTab){
         this._selectedTab = node;


         var sl = this._getScroll();


         if(sl > node.offsetLeft ||
           sl + dojo.style(this.scrollNode, "width") <
           node.offsetLeft + dojo.style(node, "width")){
          this.createSmoothScroll().play();
         }
        }


        this.inherited(arguments);
       },


       _getScrollBounds: function(){
        // summary:
        //  Returns the minimum and maximum scroll setting to show the leftmost and rightmost
        //  tabs (respectively)
        var children = this.getChildren(),
         scrollNodeWidth = dojo.style(this.scrollNode, "width"),  // about 500px
         containerWidth = dojo.style(this.containerNode, "width"), // 50,000px
         maxPossibleScroll = containerWidth - scrollNodeWidth, // scrolling until right edge of containerNode visible
         tabsWidth = this._getTabsWidth();


        if(children.length && tabsWidth > scrollNodeWidth){
         // Scrolling should happen
         return {
          min: this.isLeftToRight() ? 0 : children[children.length-1].domNode.offsetLeft,
          max: this.isLeftToRight() ?
           (children[children.length-1].domNode.offsetLeft + dojo.style(children[children.length-1].domNode, "width")) - scrollNodeWidth :
           maxPossibleScroll
         };
        }else{
         // No scrolling needed, all tabs visible, we stay either scrolled to far left or far right (depending on dir)
         var onlyScrollPosition = this.isLeftToRight() ? 0 : maxPossibleScroll;
         return {
          min: onlyScrollPosition,
          max: onlyScrollPosition
         };
        }
       },


       _getScrollForSelectedTab: function(){
        // summary:
        //  Returns the scroll value setting so that the selected tab
        //  will appear in the center
        var w = this.scrollNode,
         n = this._selectedTab,
         scrollNodeWidth = dojo.style(this.scrollNode, "width"),
         scrollBounds = this._getScrollBounds();


        // TODO: scroll minimal amount (to either right or left) so that
        // selected tab is fully visible, and just return if it's already visible?
        var pos = (n.offsetLeft + dojo.style(n, "width")/2) - scrollNodeWidth/2;
        pos = Math.min(Math.max(pos, scrollBounds.min), scrollBounds.max);


        // TODO:
        // If scrolling close to the left side or right side, scroll
        // all the way to the left or right. See this._minScroll.
        // (But need to make sure that doesn't scroll the tab out of view...)
        return pos;
       },


       createSmoothScroll: function(x){
        // summary:
        //  Creates a dojo._Animation object that smoothly scrolls the tab list
        //  either to a fixed horizontal pixel value, or to the selected tab.
        // description:
        //  If an number argument is passed to the function, that horizontal
        //  pixel position is scrolled to. Otherwise the currently selected
        //  tab is scrolled to.
        // x: Integer?
        //  An optional pixel value to scroll to, indicating distance from left.


        // Calculate position to scroll to
        if(arguments.length > 0){
         // position specified by caller, just make sure it's within bounds
         var scrollBounds = this._getScrollBounds();
         x = Math.min(Math.max(x, scrollBounds.min), scrollBounds.max);
        }else{
         // scroll to center the current tab
         x = this._getScrollForSelectedTab();
        }


        if(this._anim && this._anim.status() == "playing"){
         this._anim.stop();
        }


        var self = this,
         w = this.scrollNode,
         anim = new dojo._Animation({
          beforeBegin: function(){
           if(this.curve){ delete this.curve; }
           var oldS = w.scrollLeft,
            newS = self._convertToScrollLeft(x);
           anim.curve = new dojo._Line(oldS, newS);
          },
          onAnimate: function(val){
           w.scrollLeft = val;
          }
         });
        this._anim = anim;


        // Disable/enable left/right buttons according to new scroll position
        this._setButtonClass(x);


        return anim; // dojo._Animation
       },


       _getBtnNode: function(/*Event*/ e){
        // summary:
        //  Gets a button DOM node from a mouse click event.
        // e:
        //  The mouse click event.
        var n = e.target;
        while(n && !dojo.hasClass(n, "tabStripButton")){
         n = n.parentNode;
        }
        return n;
       },


       doSlideRight: function(/*Event*/ e){
        // summary:
        //  Scrolls the menu to the right.
        // e:
        //  The mouse click event.
        this.doSlide(1, this._getBtnNode(e));
       },


       doSlideLeft: function(/*Event*/ e){
        // summary:
        //  Scrolls the menu to the left.
        // e:
        //  The mouse click event.
        this.doSlide(-1,this._getBtnNode(e));
       },


       doSlide: function(/*Number*/ direction, /*DomNode*/ node){
        // summary:
        //  Scrolls the tab list to the left or right by 75% of the widget width.
        // direction:
        //  If the direction is 1, the widget scrolls to the right, if it is
        //  -1, it scrolls to the left.


        if(node && dojo.hasClass(node, "dijitTabDisabled")){return;}


        var sWidth = dojo.style(this.scrollNode, "width");
        var d = (sWidth * 0.75) * direction;


        var to = this._getScroll() + d;


        this._setButtonClass(to);


        this.createSmoothScroll(to).play();
       },


       _setButtonClass: function(/*Number*/ scroll){
        // summary:
        //  Disables the left scroll button if the tabs are scrolled all the way to the left,
        //  or the right scroll button in the opposite case.
        // scroll: Integer
        //  amount of horizontal scroll


        var scrollBounds = this._getScrollBounds();
        this._leftBtn.set("disabled", scroll <= scrollBounds.min);
        this._rightBtn.set("disabled", scroll >= scrollBounds.max);
       }
      });




      dojo.declare("dijit.layout._ScrollingTabControllerButtonMixin", null, {
       baseClass: "dijitTab tabStripButton",


       templateString: dojo.cache("dijit.layout","templates/_ScrollingTabControllerButton.html"),


        // Override inherited tabIndex: 0 from dijit.form.Button, because user shouldn't be
        // able to tab to the left/right/menu buttons
       tabIndex: "",


       // Similarly, override FormWidget.isFocusable() because clicking a button shouldn't focus it
       // either (this override avoids focus() call in FormWidget.js)
       isFocusable: function(){ return false; }
      });


      dojo.declare("dijit.layout._ScrollingTabControllerButton",
       [dijit.form.Button, dijit.layout._ScrollingTabControllerButtonMixin]);


      dojo.declare(
       "dijit.layout._ScrollingTabControllerMenuButton",
       [dijit.form.Button, dijit._HasDropDown, dijit.layout._ScrollingTabControllerButtonMixin],
      {
       // id of the TabContainer itself
       containerId: "",


       // -1 so user can't tab into the button, but so that button can still be focused programatically.
       // Because need to move focus to the button (or somewhere) before the menu is hidden or IE6 will crash.
       tabIndex: "-1",


       isLoaded: function(){
        // recreate menu every time, in case the TabContainer's list of children (or their icons/labels) have changed
        return false;
    • returns
      dojo._Animation
    • summary
  • dijit.layout._ScrollingTabControllerMenuButton.loadDropDown

    • type
      Function
    • parameters:
      • callback: (typeof )
    • source: [view]
        this.dropDown = new dijit.Menu({
         id: this.containerId + "_menu",
         dir: this.dir,
         lang: this.lang
        });
        var container = dijit.byId(this.containerId);
        dojo.forEach(container.getChildren(), function(page){
         var menuItem = new dijit.MenuItem({
          id: page.id + "_stcMi",
          label: page.title,
          iconClass: page.iconClass,
          dir: page.dir,
          lang: page.lang,
          onClick: function(){
           container.selectChild(page);
          }
         });
         this.dropDown.addChild(menuItem);
        }, this);
        callback();
    • summary
  • dijit.layout._ScrollingTabControllerMenuButton.closeDropDown

    • type
      Function
    • parameters:
      • focus: (typeof Boolean)
    • source: [view]
        this.inherited(arguments);
        if(this.dropDown){
         this.dropDown.destroyRecursive();
         delete this.dropDown;
        }
    • summary
  • dijit.layout._ScrollingTabControllerMenuButton.dropDown

    • summary
  • dijit.layout

    • type
      Object
    • summary
  • dijit

    • type
      Object
    • summary