Fix color picker bug (#1465)

* fix color picker bug

* minor change

* change step to stepAll

* add test

* add comments to colorpicker UI test

* add space

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
This commit is contained in:
Rishabh Shukla
2020-01-16 22:53:36 +05:30
committed by Jeffrey Warren
parent 423422a61f
commit c1c682c0a6
2 changed files with 52 additions and 1 deletions

View File

@@ -108,7 +108,7 @@ function DefaultHtmlStepUi(_sequencer, options) {
if (inputDesc.id == 'color-picker') { // Separate input field for color-picker
html +=
'<div id="color-picker" class="input-group colorpicker-component">' +
'<input class="form-control target" type="' +
'<input class="form-control color-picker-target" type="' +
inputDesc.type +
'" name="' +
paramName +
@@ -276,6 +276,21 @@ function DefaultHtmlStepUi(_sequencer, options) {
});
});
$stepAll('.color-picker-target').each(function(i, input) {
$(input)
.data('initValue', $(input).val())
.data('hasChangedBefore', false)
.on('input change', function() {
$(this)
.data('hasChangedBefore',
handleInputValueChange(
$(this).val(),
$(this).data('initValue'),
$(this).data('hasChangedBefore')
)
);
});
});
$('input[type="range"]').on('input', function() {