Commit a211fa6e authored by jgould's avatar jgould

don't set min and max on min and max changed

parent 3eb03e49
...@@ -429,7 +429,7 @@ morpheus.HeatMapColorScheme.prototype = { ...@@ -429,7 +429,7 @@ morpheus.HeatMapColorScheme.prototype = {
: new morpheus.GradientColorSupplier(); : new morpheus.GradientColorSupplier();
newColorSupplier.sizer = oldColorSupplier.getSizer(); newColorSupplier.sizer = oldColorSupplier.getSizer();
newColorSupplier.conditions = oldColorSupplier.getConditions(); newColorSupplier.conditions = oldColorSupplier.getConditions();
newColorSupplier.getScalingMode(oldColorSupplier.getScalingMode()); newColorSupplier.setScalingMode(oldColorSupplier.getScalingMode());
newColorSupplier.setMin(oldColorSupplier.getMin()); newColorSupplier.setMin(oldColorSupplier.getMin());
newColorSupplier.setMax(oldColorSupplier.getMax()); newColorSupplier.setMax(oldColorSupplier.getMax());
newColorSupplier.setFractions({ newColorSupplier.setFractions({
...@@ -449,8 +449,8 @@ morpheus.HeatMapColorScheme.prototype = { ...@@ -449,8 +449,8 @@ morpheus.HeatMapColorScheme.prototype = {
_.each(_.keys(this.rowValueToColorSupplier), function(key) { _.each(_.keys(this.rowValueToColorSupplier), function(key) {
// save each scheme // save each scheme
var val = _this.rowValueToColorSupplier[key]; var val = _this.rowValueToColorSupplier[key];
// delete val.sizer; // delete val.sizer;
// delete val.conditions; // delete val.conditions;
json.colorSchemes[key] = val; json.colorSchemes[key] = val;
}); });
......
...@@ -140,29 +140,26 @@ morpheus.HeatMapColorSchemeChooser = function(options) { ...@@ -140,29 +140,26 @@ morpheus.HeatMapColorSchemeChooser = function(options) {
formBuilder.$form.on('change', '[name=missing_color]', function(e) { formBuilder.$form.on('change', '[name=missing_color]', function(e) {
var color = $(this).val(); var color = $(this).val();
that.colorScheme.setMissingColor(color); that.colorScheme.setMissingColor(color);
that.fireChanged(); that.fireChanged(false);
}); });
formBuilder.$form.on('change', '[name=stepped_colors]', function(e) { formBuilder.$form.on('change', '[name=stepped_colors]', function(e) {
that.colorScheme.setStepped($(this).prop('checked')); that.colorScheme.setStepped($(this).prop('checked'));
that.fireChanged(); that.fireChanged();
}); });
formBuilder.$form.on('keyup', '[name=minimum]', _.debounce(function(e) { formBuilder.$form.on('keyup', '[name=minimum]', _.debounce(function(e) {
var val = parseFloat($(this).val()); var val = parseFloat($(this).val());
if (!isNaN(val)) { if (!isNaN(val)) {
that.colorScheme.setMin(val); that.colorScheme.setMin(val);
that.setSelectedIndex(that.legend.selectedIndex); that.setSelectedIndex(that.legend.selectedIndex);
that.fireChanged(); that.fireChanged(false);
} }
}, 100)); }, 100));
formBuilder.$form.on('keyup', '[name=maximum]', _.debounce(function(e) { formBuilder.$form.on('keyup', '[name=maximum]', _.debounce(function(e) {
var val = parseFloat($(this).val()); var val = parseFloat($(this).val());
if (!isNaN(val)) { if (!isNaN(val)) {
that.colorScheme.setMax(val); that.colorScheme.setMax(val);
that.setSelectedIndex(that.legend.selectedIndex); that.setSelectedIndex(that.legend.selectedIndex);
that.fireChanged(); that.fireChanged(false);
} }
}, 100)); }, 100));
...@@ -290,10 +287,11 @@ morpheus.HeatMapColorSchemeChooser.prototype = { ...@@ -290,10 +287,11 @@ morpheus.HeatMapColorSchemeChooser.prototype = {
[ this.legend.border, [ this.legend.border,
this.legend.getUnscaledWidth() - this.legend.border ]); this.legend.getUnscaledWidth() - this.legend.border ]);
}, },
fireChanged : function() { fireChanged : function(noreset) {
this.trigger('change'); this.trigger('change');
// restore currentValue if (noreset !== false) {
this.setColorScheme(this.colorScheme); this.setColorScheme(this.colorScheme);
}
}, },
draw : function() { draw : function() {
var colorScheme = this.colorScheme; var colorScheme = this.colorScheme;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment