Changeset 189845 in webkit
- Timestamp:
- Sep 15, 2015 9:22:21 PM (9 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r189828 r189845 1 2015-09-15 Devin Rousso <dcrousso+webkit@gmail.com> 2 3 Web Inspector: Picking unchanged for font-size does not reset back to the unchanged value 4 https://bugs.webkit.org/show_bug.cgi?id=148351 5 6 Reviewed by Brian Burg. 7 8 Visual number editors now save any new values in the special placeholder element 9 to display it whenever the "Unchanged" option is selected by the user. 10 11 * UserInterface/Views/VisualStyleNumberInputBox.js: 12 (WebInspector.VisualStyleNumberInputBox.prototype.set value): 13 (WebInspector.VisualStyleNumberInputBox.prototype.set units): 14 (WebInspector.VisualStyleNumberInputBox.prototype._setNumberInputIsEditable): 15 (WebInspector.VisualStyleNumberInputBox.prototype._keywordChanged): 16 (WebInspector.VisualStyleNumberInputBox.prototype._valueNumberInputKeyDown.adjustValue): 17 (WebInspector.VisualStyleNumberInputBox.prototype._valueNumberInputKeyDown): 18 1 19 2015-09-15 Brian Burg <bburg@apple.com> 2 20 -
trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleNumberInputBox.js
r189210 r189845 112 112 return; 113 113 114 if (this._updatedValues.propertyMissing && isNaN(value)) { 115 this._unchangedOptionElement.selected = true; 116 this._numberInputIsEditable = false; 117 this.contentElement.classList.remove("number-input-editable"); 118 this.specialPropertyPlaceholderElement.hidden = false; 119 return; 114 if (this._updatedValues.propertyMissing) { 115 if (value || this._updatedValues.placeholder) 116 this.specialPropertyPlaceholderElement.textContent = (value || this._updatedValues.placeholder) + (this._updatedValues.units || ""); 117 118 if (isNaN(value)) { 119 this._unchangedOptionElement.selected = true; 120 this._setNumberInputIsEditable(); 121 this.specialPropertyPlaceholderElement.hidden = false; 122 return; 123 } 120 124 } 121 125 … … 129 133 130 134 if (!isNaN(value)) { 131 this._numberInputIsEditable = true; 132 this.contentElement.classList.add("number-input-editable"); 135 this._setNumberInputIsEditable(true); 133 136 this._valueNumberInputElement.value = Math.round(value * 100) / 100; 134 137 this._markUnitsContainerIfInputHasValue(); … … 137 140 138 141 if (this.valueIsSupportedKeyword(value)) { 139 this._numberInputIsEditable = false; 140 this.contentElement.classList.remove("number-input-editable"); 142 this._setNumberInputIsEditable(); 141 143 this._keywordSelectElement.value = value; 142 144 return; … … 170 172 this._addAdvancedUnits(); 171 173 172 this._numberInputIsEditable = true; 173 this.contentElement.classList.add("number-input-editable"); 174 this._setNumberInputIsEditable(true); 174 175 this._keywordSelectElement.value = unit; 175 176 this._unitsElementTextContent = unit; … … 230 231 this._unitsElement.textContent = text; 231 232 this._markUnitsContainerIfInputHasValue(); 233 } 234 235 _setNumberInputIsEditable(flag) 236 { 237 this._numberInputIsEditable = flag || false; 238 this.contentElement.classList.toggle("number-input-editable", this._numberInputIsEditable); 232 239 } 233 240 … … 247 254 248 255 this._unitsElementTextContent = this._keywordSelectElement.value; 249 this._ numberInputIsEditable = selectedKeywordIsUnit;250 this.contentElement.classList.toggle("number-input-editable", selectedKeywordIsUnit);251 }256 this._setNumberInputIsEditable(selectedKeywordIsUnit); 257 } else 258 this._setNumberInputIsEditable(false); 252 259 253 260 this._valueDidChange(); … … 273 280 newValue = 0; 274 281 282 this._updatedValues.propertyMissing = false; 275 283 this.value = Math.round(newValue * 100) / 100; 276 284 this._valueDidChange();
Note: See TracChangeset
for help on using the changeset viewer.