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 = {
: new morpheus.GradientColorSupplier();
newColorSupplier.sizer = oldColorSupplier.getSizer();
newColorSupplier.conditions = oldColorSupplier.getConditions();
newColorSupplier.getScalingMode(oldColorSupplier.getScalingMode());
newColorSupplier.setScalingMode(oldColorSupplier.getScalingMode());
newColorSupplier.setMin(oldColorSupplier.getMin());
newColorSupplier.setMax(oldColorSupplier.getMax());
newColorSupplier.setFractions({
......@@ -449,8 +449,8 @@ morpheus.HeatMapColorScheme.prototype = {
_.each(_.keys(this.rowValueToColorSupplier), function(key) {
// save each scheme
var val = _this.rowValueToColorSupplier[key];
// delete val.sizer;
// delete val.conditions;
// delete val.sizer;
// delete val.conditions;
json.colorSchemes[key] = val;
});
......
......@@ -140,29 +140,26 @@ morpheus.HeatMapColorSchemeChooser = function(options) {
formBuilder.$form.on('change', '[name=missing_color]', function(e) {
var color = $(this).val();
that.colorScheme.setMissingColor(color);
that.fireChanged();
that.fireChanged(false);
});
formBuilder.$form.on('change', '[name=stepped_colors]', function(e) {
that.colorScheme.setStepped($(this).prop('checked'));
that.fireChanged();
});
formBuilder.$form.on('keyup', '[name=minimum]', _.debounce(function(e) {
var val = parseFloat($(this).val());
if (!isNaN(val)) {
that.colorScheme.setMin(val);
that.setSelectedIndex(that.legend.selectedIndex);
that.fireChanged();
that.fireChanged(false);
}
}, 100));
formBuilder.$form.on('keyup', '[name=maximum]', _.debounce(function(e) {
var val = parseFloat($(this).val());
if (!isNaN(val)) {
that.colorScheme.setMax(val);
that.setSelectedIndex(that.legend.selectedIndex);
that.fireChanged();
that.fireChanged(false);
}
}, 100));
......@@ -290,10 +287,11 @@ morpheus.HeatMapColorSchemeChooser.prototype = {
[ this.legend.border,
this.legend.getUnscaledWidth() - this.legend.border ]);
},
fireChanged : function() {
fireChanged : function(noreset) {
this.trigger('change');
// restore currentValue
this.setColorScheme(this.colorScheme);
if (noreset !== false) {
this.setColorScheme(this.colorScheme);
}
},
draw : function() {
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