Changeset 1212

Show
Ignore:
Timestamp:
07/02/09 23:51:03 (4 years ago)
Author:
tschaub
Message:

If the visible background layer is dragged out of the background group, we have to make a new layer in that group visible.

Files:

Legend:

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

    r1211 r1212  
    558558                if(record.get("group") === "background") { 
    559559                    updateBackground(store, record); 
     560                } else { 
     561                    // the visible background layer might have been moved to a new group 
     562                    var candidate; 
     563                    store.each(function(r) { 
     564                        if(r.get("group") === "background") { 
     565                            candidate = r; 
     566                            return false; 
     567                        } 
     568                    }); 
     569                    if(candidate) { 
     570                        updateBackground(store, candidate); 
     571                    } 
    560572                } 
    561573            }