diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index dd117c4c7b1abad4a3ddc27159f2ce43a530bdf9..61fbc7a9ad2987c34b10b9604b9d764c73b666a8 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -785,6 +785,13 @@ App.RA.options = (function() { return what === "" ? null : parseInt(what); } + setValue(what) { + if (_.isNumber(what)) { // shortcut list data is just numbers, turn them into targets + what = App.RA.makeTarget(this.opSelector.value, what); + } + super.setValue(what); + } + setTextValue(what) { if (typeof what === 'number') { // comes from a pre-set this.numEditor.value = what.toString(); @@ -801,12 +808,6 @@ App.RA.options = (function() { const v = this.parse(this.numEditor.value); return v === null ? null : App.RA.makeTarget(this.opSelector.value, v); } - - propagateChange() { - if (this.onchange instanceof Function) { - this.onchange(App.RA.makeTarget(this.opSelector.value, this.getData())); - } - } } class NumericRangeEditor extends EditorWithShortcuts { @@ -939,6 +940,13 @@ App.RA.options = (function() { return res; } + setValue(what) { + if (_.isNumber(what)) { // shortcut list data is just numbers, turn them into targets + what = App.RA.makeTarget(this.opSelector.value, what); + } + super.setValue(what); + } + setTextValue(what) { if (typeof what === 'number') { this.numEditor.value = what.toString();