Changeset 1096

Show
Ignore:
Timestamp:
2008-09-15 06:01:29 (2 months ago)
Author:
MaierMan
Message:
  • Fix isEditable
  • Smaller function bodies
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/chrome/content/dta/select.js

    r1086 r1096  
    149149                } 
    150150        }, 
    151         isChecked: function(idx) { 
    152                 return this._links[idx].checked.length != 0; 
    153         }, 
     151        isChecked: function(idx) this._links[idx].checked.length != 0, 
    154152 
    155153        /* 
    156154         * actual nsITreeView follows 
    157155         */ 
    158         get rowCount() { 
    159                 // quite easy.. we have a static list. 
    160                 return this._links.length; 
    161         }, 
     156        get rowCount() this._links.length, 
    162157 
    163158        // used to initialize nsITreeview and provide the corresponding treeBoxObject 
     
    166161        }, 
    167162 
    168         getParentIndex: function(idx) { 
    169                 // no parents, as we are actually a list 
    170                 return -1; 
    171         }, 
    172         getLevel: function(idx) { 
    173                 // ... and being a list all nodes are on the same level 
    174                 return 0; 
    175         }, 
     163        getParentIndex: function(idx) -1, 
     164        getLevel: function(idx) 0, 
     165         
    176166        getCellText: function(idx, col) { 
    177167 
     
    199189        }, 
    200190 
    201         isSorted: function() { 
    202                 return !!this._sortColumn; 
    203         }, 
    204         isContainer: function(idx) { 
    205                 // being a container means we got children... but we don't have any children 
    206                 // because we're a list actually 
    207                 return false; 
    208         }, 
    209         isContainerOpen: function(idx) { 
    210                 return false; 
    211         }, 
    212         isContainerEmpty: function(idx) { 
    213                 return false; 
    214         }, 
    215  
    216         isSeparator: function(idx) { 
    217                 // no separators 
    218                 return false; 
    219         }, 
    220  
    221         isEditable: function(idx) { 
    222                 // and nothing is editable 
    223                 return true; 
    224         }, 
     191        isSorted: function() !!this._sortColumn, 
     192        isContainer: function(idx) false, 
     193        isContainerOpen: function(idx) false, 
     194        isContainerEmpty: function(idx) false, 
     195        isSeparator: function(idx) false, 
     196        isEditable: function(idx) false, 
    225197 
    226198        // will grab the "icon" for a cell.