mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 07:53:08 +02:00
CreateApp - Fix active colorPicker to update on selection update
This commit is contained in:
parent
8acae02203
commit
7d9cad3e8e
1 changed files with 15 additions and 2 deletions
|
@ -2151,7 +2151,6 @@ function createColorProperty(property, elProperty) {
|
||||||
submit: false, // We don't want to have a submission button
|
submit: false, // We don't want to have a submission button
|
||||||
onShow: function(colpick) {
|
onShow: function(colpick) {
|
||||||
console.log("Showing");
|
console.log("Showing");
|
||||||
$(colorPickerID).attr('active', 'true');
|
|
||||||
// The original color preview within the picker needs to be updated on show because
|
// The original color preview within the picker needs to be updated on show because
|
||||||
// prior to the picker being shown we don't have access to the selections' starting color.
|
// prior to the picker being shown we don't have access to the selections' starting color.
|
||||||
colorPickers[colorPickerID].colpickSetColor({
|
colorPickers[colorPickerID].colpickSetColor({
|
||||||
|
@ -2159,13 +2158,17 @@ function createColorProperty(property, elProperty) {
|
||||||
"g": elNumberG.elInput.value,
|
"g": elNumberG.elInput.value,
|
||||||
"b": elNumberB.elInput.value
|
"b": elNumberB.elInput.value
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(colorPickerID).attr('active', 'true');
|
||||||
},
|
},
|
||||||
onHide: function(colpick) {
|
onHide: function(colpick) {
|
||||||
$(colorPickerID).attr('active', 'false');
|
$(colorPickerID).attr('active', 'false');
|
||||||
},
|
},
|
||||||
onChange: function(hsb, hex, rgb, el) {
|
onChange: function(hsb, hex, rgb, el) {
|
||||||
$(el).css('background-color', '#' + hex);
|
$(el).css('background-color', '#' + hex);
|
||||||
emitColorPropertyUpdate(propertyName, rgb.r, rgb.g, rgb.b);
|
if ($(colorPickerID).attr('active') === 'true') {
|
||||||
|
emitColorPropertyUpdate(propertyName, rgb.r, rgb.g, rgb.b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3351,6 +3354,16 @@ function loaded() {
|
||||||
property.elColorPicker.style.backgroundColor = "rgb(" + propertyValue.red + "," +
|
property.elColorPicker.style.backgroundColor = "rgb(" + propertyValue.red + "," +
|
||||||
propertyValue.green + "," +
|
propertyValue.green + "," +
|
||||||
propertyValue.blue + ")";
|
propertyValue.blue + ")";
|
||||||
|
if ($(property.elColorPicker).attr('active') === 'true') {
|
||||||
|
$(property.elColorPicker).attr('active', 'false');
|
||||||
|
colorPickers['#' + property.elementID].colpickSetColor({
|
||||||
|
"r": propertyValue.red,
|
||||||
|
"g": propertyValue.green,
|
||||||
|
"b": propertyValue.blue
|
||||||
|
});
|
||||||
|
$(property.elColorPicker).attr('active', 'true');
|
||||||
|
}
|
||||||
|
|
||||||
property.elNumberR.setValue(propertyValue.red);
|
property.elNumberR.setValue(propertyValue.red);
|
||||||
property.elNumberG.setValue(propertyValue.green);
|
property.elNumberG.setValue(propertyValue.green);
|
||||||
property.elNumberB.setValue(propertyValue.blue);
|
property.elNumberB.setValue(propertyValue.blue);
|
||||||
|
|
Loading…
Reference in a new issue