B2G/gecko/browser/components/tabview/tabitems.js
// Add an item to be prioritized
Add an item to be prioritized
Add an item to be prioritized
function TabPriorityQueue_push(tab) {
    let item = tab._tabViewTabItem;
    if (item.parent && (item.parent.isStacked() &&
      !item.parent.isTopOfStack(item) &&
      !item.parent.expanded)) {
      let idx = this._high.indexOf(tab);
      if (idx != -1) {
        this._high.splice(idx, 1);
        this._low.unshift(tab);
      } else if (this._low.indexOf(tab) == -1)
        this._low.unshift(tab);
    } else {
      let idx = this._low.indexOf(tab);
      if (idx != -1) {
        this._low.splice(idx, 1);
        this._high.unshift(tab);
      } else if (this._high.indexOf(tab) == -1)
        this._high.unshift(tab);
    }
  }
function TabPriorityQueue_push ( tab ) { let item = tab . _tabViewTabItem ; if ( item . parent && ( item . parent . isStacked ( ) && ! item . parent . isTopOfStack ( item ) && ! item . parent . expanded ) ) { let idx = this . _high . indexOf ( tab ) ; if ( idx != - 1 ) { this . _high . splice ( idx , 1 ) ; this . _low . unshift ( tab ) ; } else if ( this . _low . indexOf ( tab ) == - 1 ) this . _low . unshift ( tab ) ; } else { let idx = this . _low . indexOf ( tab ) ; if ( idx != - 1 ) { this . _low . splice ( idx , 1 ) ; this . _high . unshift ( tab ) ; } else if ( this . _high . indexOf ( tab ) == - 1 ) this . _high . unshift ( tab ) ; } }
Add an item to be prioritized
Add an item to be prioritized
// Push onto correct priority queue. // It's only low priority if it's in a stack, and isn't the top, // and the stack isn't expanded. // If it already exists in the destination queue, // leave it. If it exists in a different queue, remove it first and push // onto new queue.