B2G/gecko/browser/components/tabview/ui.js
// Resets the Panorama view to have just one group with all tabs
Resets the Panorama view to have just one group with all tabs
Resets the Panorama view to have just one group with all tabs
function UI_reset() {
    let padding = Trenches.defaultRadius;
    let welcomeWidth = 300;
    let pageBounds = Items.getPageBounds();
    pageBounds.inset(padding, padding);
    let $actions = iQ("#actions");
    if ($actions) {
      pageBounds.width -= $actions.width();
      if (UI.rtl)
        pageBounds.left += $actions.width() - padding;
    }
    let box = new Rect(pageBounds);
    box.width = Math.min(box.width * 0.667,
                         pageBounds.width - (welcomeWidth + padding));
    box.height = box.height * 0.667;
    if (UI.rtl) {
      box.left = pageBounds.left + welcomeWidth + 2 * padding;
    }
    GroupItems.groupItems.forEach(function(group) {
      group.close();
    });
    let options = {
      bounds: box,
      immediately: true
    };
    let groupItem = new GroupItem([], options);
    let items = TabItems.getItems();
    items.forEach(function(item) {
      if (item.parent)
        item.parent.remove(item);
      groupItem.add(item, {immediately: true});
    });
    this.setActive(groupItem);
  }
function UI_reset ( ) { let padding = Trenches . defaultRadius ; let welcomeWidth = 300 ; let pageBounds = Items . getPageBounds ( ) ; pageBounds . inset ( padding , padding ) ; let $actions = iQ ( "#actions" ) ; if ( $actions ) { pageBounds . width -= $actions . width ( ) ; if ( UI . rtl ) pageBounds . left += $actions . width ( ) - padding ; } let box = new Rect ( pageBounds ) ; box . width = Math . min ( box . width * 0.667 , pageBounds . width - ( welcomeWidth + padding ) ) ; box . height = box . height * 0.667 ; if ( UI . rtl ) { box . left = pageBounds . left + welcomeWidth + 2 * padding ; } GroupItems . groupItems . forEach ( function ( group ) { group . close ( ) ; } ) ; let options = { bounds : box , immediately : true } ; let groupItem = new GroupItem ( [ ] , options ) ; let items = TabItems . getItems ( ) ; items . forEach ( function ( item ) { if ( item . parent ) item . parent . remove ( item ) ; groupItem . add ( item , { immediately : true } ) ; } ) ; this . setActive ( groupItem ) ; }
Resets the Panorama view to have just one group with all tabs
Resets the Panorama view to have just one group with all tabs
// ___ make a fresh groupItem