B2G/gecko/browser/components/tabview/groupitems.js
//   dontArrange - (bool) if true, will not trigger an arrange on the group
(bool) if true, will not trigger an arrange on the group
( bool ) if true will not trigger an arrange on the group
function GroupItem_add(a, options) {
    try {
      var item;
      var $el;
      if (a.isAnItem) {
        item = a;
        $el = iQ(a.container);
      } else {
        $el = iQ(a);
        item = Items.item($el);
      }
      if (item.parent && item.parent !== this)
        item.parent.remove(item);
      item.removeTrenches();
      if (!options)
        options = {};
      var self = this;
      var wasAlreadyInThisGroupItem = false;
      var oldIndex = this._children.indexOf(item);
      if (oldIndex != -1) {
        this._children.splice(oldIndex, 1);
        wasAlreadyInThisGroupItem = true;
      }
      var index = ("index" in options) ? options.index : this._children.length;
      this._children.splice(index, 0, item);
      item.setZ(this.getZ() + 1);
      if (!wasAlreadyInThisGroupItem) {
        item.droppable(false);
        item.groupItemData = {};
        item.addSubscriber("close", this._onChildClose);
        item.setParent(this);
        $el.attr("data-group-id", this.id);
        if (typeof item.setResizable == 'function')
          item.setResizable(false, options.immediately);
        if (item == UI.getActiveTab() || !this._activeTab)
          this.setActiveTab(item);
        if (item.tab == gBrowser.selectedTab ||
            (!GroupItems.getActiveGroupItem() && !item.tab.hidden))
          UI.setActive(this);
      }
      if (!options.dontArrange)
        this.arrange({animate: !options.immediately});
      this._unfreezeItemSize({dontArrange: true});
      this._sendToSubscribers("childAdded", { item: item });
      UI.setReorderTabsOnHide(this);
    } catch(e) {
      Utils.log('GroupItem.add error', e);
    }
  }
function GroupItem_add ( a , options ) { try { var item ; var $el ; if ( a . isAnItem ) { item = a ; $el = iQ ( a . container ) ; } else { $el = iQ ( a ) ; item = Items . item ( $el ) ; } if ( item . parent && item . parent !== this ) item . parent . remove ( item ) ; item . removeTrenches ( ) ; if ( ! options ) options = { } ; var self = this ; var wasAlreadyInThisGroupItem = false ; var oldIndex = this . _children . indexOf ( item ) ; if ( oldIndex != - 1 ) { this . _children . splice ( oldIndex , 1 ) ; wasAlreadyInThisGroupItem = true ; } var index = ( "index" in options ) ? options . index : this . _children . length ; this . _children . splice ( index , 0 , item ) ; item . setZ ( this . getZ ( ) + 1 ) ; if ( ! wasAlreadyInThisGroupItem ) { item . droppable ( false ) ; item . groupItemData = { } ; item . addSubscriber ( "close" , this . _onChildClose ) ; item . setParent ( this ) ; $el . attr ( "data-group-id" , this . id ) ; if ( typeof item . setResizable == 'function' ) item . setResizable ( false , options . immediately ) ; if ( item == UI . getActiveTab ( ) || ! this . _activeTab ) this . setActiveTab ( item ) ; if ( item . tab == gBrowser . selectedTab || ( ! GroupItems . getActiveGroupItem ( ) && ! item . tab . hidden ) ) UI . setActive ( this ) ; } if ( ! options . dontArrange ) this . arrange ( { animate : ! options . immediately } ) ; this . _unfreezeItemSize ( { dontArrange : true } ) ; this . _sendToSubscribers ( "childAdded" , { item : item } ) ; UI . setReorderTabsOnHide ( this ) ; } catch ( e ) { Utils . log ( 'GroupItem.add error' , e ) ; } }
dontArrange - (bool) if true, will not trigger an arrange on the group
dontArrange - ( bool ) if true will not trigger an arrange on the group
// safeguard to remove the item from its previous group // Insert the tab into the right position. // if it matches the selected tab or no active tab and the browser // tab is hidden, the active group item would be set.