mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1213412 - don't override property while editing. r=bgrins
This commit is contained in:
parent
1189d2abd3
commit
90ce2b7ece
@ -1089,9 +1089,11 @@ SwatchBasedEditorTooltip.prototype = {
|
||||
*/
|
||||
revert: function() {
|
||||
if (this.activeSwatch) {
|
||||
let swatch = this.swatches.get(this.activeSwatch);
|
||||
swatch.callbacks.onRevert();
|
||||
this._reverted = true;
|
||||
let swatch = this.swatches.get(this.activeSwatch);
|
||||
this.tooltip.once("hiding", () => {
|
||||
swatch.callbacks.onRevert();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -3418,8 +3418,9 @@ TextPropertyEditor.prototype = {
|
||||
!this.isValid() ||
|
||||
!this.prop.overridden;
|
||||
|
||||
if (this.prop.overridden || !this.prop.enabled ||
|
||||
!this.prop.isKnownProperty()) {
|
||||
if (!this.editing &&
|
||||
(this.prop.overridden || !this.prop.enabled ||
|
||||
!this.prop.isKnownProperty())) {
|
||||
this.element.classList.add("ruleview-overridden");
|
||||
} else {
|
||||
this.element.classList.remove("ruleview-overridden");
|
||||
@ -3804,7 +3805,7 @@ TextPropertyEditor.prototype = {
|
||||
* value of this property before editing.
|
||||
*/
|
||||
_onSwatchRevert: function() {
|
||||
this._previewValue(this.prop.value);
|
||||
this._previewValue(this.prop.value, true);
|
||||
this.update();
|
||||
},
|
||||
|
||||
@ -3860,11 +3861,13 @@ TextPropertyEditor.prototype = {
|
||||
*
|
||||
* @param {String} value
|
||||
* The value to set the current property to.
|
||||
* @param {Boolean} reverting
|
||||
* True if we're reverting the previously previewed value
|
||||
*/
|
||||
_previewValue: function(value) {
|
||||
_previewValue: function(value, reverting = false) {
|
||||
// Since function call is throttled, we need to make sure we are still
|
||||
// editing, and any selector modifications have been completed
|
||||
if (!this.editing || this.ruleEditor.isEditing) {
|
||||
if (!reverting && (!this.editing || this.ruleEditor.isEditing)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,9 @@ function* testCreateNew(view) {
|
||||
is(editor, inplaceEditor(textProp.editor.valueSpan),
|
||||
"Editing the value span now.");
|
||||
|
||||
ok(!textProp.editor.element.classList.contains("ruleview-overridden"),
|
||||
"property should not be overridden.");
|
||||
|
||||
info("Entering a value and bluring the field to expect a rule change");
|
||||
editor.input.value = "#XYZ";
|
||||
let onBlur = once(editor.input, "blur");
|
||||
|
Loading…
Reference in New Issue
Block a user