Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Fixed regression where image download would not switch back to the original palette

Mike McGanne0c30ae43ae9
diff --git a/js/Worldview/Widget/Palette.js b/js/Worldview/Widget/Palette.js
index 6365075a3..885fd05e5 100644
--- a/js/Worldview/Widget/Palette.js
+++ b/js/Worldview/Widget/Palette.js
@@ -23,6 +23,7 @@ Worldview.Widget.Palette = function(containerId, config, spec) {
self.active = {};
self.inactive = {};
self.alignTo = spec.alignTo;
+ self.noRestore = false;
var init = function() {
//Logging.debug("Worldview.Widget.Palette");
@@ -97,7 +98,8 @@ Worldview.Widget.Palette = function(containerId, config, spec) {
}
});
$.each(self.inactive, function(product, palette) {
- if ( $.inArray(product, state.products) >= 0 &&
+ if ( !self.noRestore &&
+ $.inArray(product, state.products) >= 0 &&
!self.active[product] ) {
log.debug("Restoring palette for " + product);
self.active[product] = self.inactive[product];
diff --git a/js/main.js b/js/main.js
index e6d652311..7e6a5dd8d 100644
--- a/js/main.js
+++ b/js/main.js
@@ -96,14 +96,6 @@ $(function() {// Initialize "static" vars
$.each(initOrder, function(index, component) {
component.loadFromQuery(queryString);
});
- /*
- var comps = REGISTRY.getComponents();
- for (var i=0; i < comps.length; i++) {
- if(typeof comps[i].obj.loadFromQuery == 'function'){
- comps[i].obj.loadFromQuery(queryString);
- }
- }
- */
REGISTRY.isLoadingQuery = false;
}
diff --git a/js/rubberBand.js b/js/rubberBand.js
index fe4181951..530589a71 100644
--- a/js/rubberBand.js
+++ b/js/rubberBand.js
@@ -92,6 +92,7 @@ SOTE.widget.RubberBand.toggle = function(o){
// Save the previous state to be restored later
self.previousPalettes = self.currentPalettes;
+ self.paletteWidget.noRestore = true;
self.paletteWidget.setValue("");
};
@@ -114,6 +115,7 @@ SOTE.widget.RubberBand.toggle = function(o){
self.jcropAPI.destroy();
$("#imagedownload").hide('slide', {direction: 'up'}, 1000);
if (self.previousPalettes) {
+ self.paletteWidget.noResture = false;
self.paletteWidget.setValue(self.previousPalettes);
}
}