Changeset 314

Show
Ignore:
Timestamp:
05/28/07 10:58:06 (18 months ago)
Author:
t-bone
Message:

Closes #52

  • Set all, not just the first, initial load (homepag) tabs to the right size.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • extension/tabcontrol/content/tabcontrol.js

    r66 r314  
    2727    } 
    2828 
    29     //initial tab's width 
    30     gBrowser.mTabContainer.firstChild.minWidth= 
    31         gTabControl.getPref('int', 'tabcontrol.tabMinWidth'); 
    32     gBrowser.mTabContainer.firstChild.maxWidth= 
    33         gTabControl.getPref('int', 'tabcontrol.tabMaxWidth'); 
     29    //initial tabs' (or tabs') width 
     30    for (var i=0, t=null; t=gBrowser.mTabContainer.childNodes[i]; i++) { 
     31        t.minWidth=gTabControl.getPref('int', 'tabcontrol.tabMinWidth'); 
     32        t.maxWidth=gTabControl.getPref('int', 'tabcontrol.tabMaxWidth'); 
     33    } 
    3434 
    3535    //get reference to string bundle 
     
    4141    duplicateTabItem.setAttribute('accesskey', bundle.getString('duplicateTabAccessKey')); 
    4242    duplicateTabItem.setAttribute('oncommand', 'gTabControl.duplicateTab(this);'); 
    43      
     43 
    4444    var tabMenu=document 
    4545        .getAnonymousElementByAttribute(gBrowser, 'anonid', 'tabContextMenu'); 
     
    9595    //skip the rest if we don't need to focus a custom tab 
    9696    if (null==tabToSelect) return; 
    97      
     97 
    9898    //set focus to the tab that we want 
    9999    gTabControl.selectTab(tabToSelect); 
     
    111111BrowserCloseTabOrWindow:function() { 
    112112    //NOPE!  only close tabs 
    113     if (gBrowser.localName == 'tabbrowser' &&  
     113    if (gBrowser.localName == 'tabbrowser' && 
    114114        gBrowser.tabContainer.childNodes.length > 1 
    115115    ) { 
     
    123123    var originalHistory=gBrowser.getBrowserForTab(aTab) 
    124124        .webNavigation.sessionHistory; 
    125      
     125 
    126126    var newTab=gBrowser.addTab(); 
    127127    var newHistory=gBrowser.getBrowserForTab(newTab) 
     
    154154        case 'int':    return this.prefObj.getIntPref(aName); 
    155155        case 'string': 
    156         default:       return this.prefObj.getCharPref(aName);  
     156        default:       return this.prefObj.getCharPref(aName); 
    157157        } 
    158     } catch (e) {  
     158    } catch (e) { 
    159159        return gTabControl.prefDefaults[aName]; 
    160160    } 
     
    198198        try { 
    199199            texts[i].value=gTabControl.getPref( 
    200                 texts[i].getAttribute('preftype'),  
     200                texts[i].getAttribute('preftype'), 
    201201                texts[i].getAttribute('prefstring') 
    202202            ); 
     
    214214            gTabControl.setPref( 
    215215                'bool', 
    216                 'tabcontrol.'+checks[i].getAttribute('id'),  
     216                'tabcontrol.'+checks[i].getAttribute('id'), 
    217217                checks[i].checked 
    218218            ); 
     
    225225        try { 
    226226            gTabControl.setPref( 
    227                 'int',  
     227                'int', 
    228228                drops[i].getAttribute('prefstring'), 
    229229                drops[i].selectedItem.value