Changeset 1218

Show
Ignore:
Timestamp:
07/04/09 02:28:06 (4 years ago)
Author:
tschaub
Message:

IE doesn't like the insert at an index bigger than the item count.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • apps/opengeo/geoexplorer/trunk/src/script/app/GeoExplorer/Embed.js

    r1217 r1218  
    130130                var layer = record.get("layer"); 
    131131                if(layer.displayInLayerSwitcher) { 
    132                     menu.insert(2, new Ext.menu.CheckItem({ 
     132                    var item = new Ext.menu.CheckItem({ 
    133133                        text: record.get("title"), 
    134134                        checked: record.get("layer").getVisibility(), 
     
    139139                            } 
    140140                        } 
    141                     })); 
     141                    }); 
     142                    if (menu.items.getCount() > 2) { 
     143                        menu.insert(2, item); 
     144                    } else { 
     145                        menu.add(item); 
     146                    } 
    142147                } 
    143148            });