Chromium Code Reviews| Index: Source/devtools/front_end/elements/StylesSidebarPane.js |
| diff --git a/Source/devtools/front_end/elements/StylesSidebarPane.js b/Source/devtools/front_end/elements/StylesSidebarPane.js |
| index e5459e7a4cd0ecf6fb87144b2cb43246458e2c46..64e0f6dadeedb57ed74971105054a42bb653f3e5 100644 |
| --- a/Source/devtools/front_end/elements/StylesSidebarPane.js |
| +++ b/Source/devtools/front_end/elements/StylesSidebarPane.js |
| @@ -3285,8 +3285,22 @@ WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = { |
| this._sidebarPane.applyStyleText(this._sidebarPane.nameElement.textContent + ": " + this._sidebarPane.valueElement.textContent, false, false, false); |
| } |
| + /** |
| + * @param {string} prefix |
| + * @param {number} number |
| + * @param {string} suffix |
| + * @return {string} |
| + * @this {WebInspector.StylesSidebarPane.CSSPropertyPrompt} |
| + */ |
| + function customNumberHandler(prefix, number, suffix) |
| + { |
| + if (!suffix.length && WebInspector.CSSMetadata.isLengthProperty(this._sidebarPane.property.name)) |
|
apavlov
2014/06/24 15:22:27
please don't require the suffix for 0
lushnikov
2014/06/24 15:39:46
Done.
|
| + suffix = "px"; |
| + return prefix + number + suffix; |
| + } |
| + |
| // Handle numeric value increment/decrement only at this point. |
| - if (!this._isEditingName && WebInspector.handleElementValueModifications(event, this._sidebarPane.valueElement, finishHandler.bind(this), this._isValueSuggestion.bind(this))) |
| + if (!this._isEditingName && WebInspector.handleElementValueModifications(event, this._sidebarPane.valueElement, finishHandler.bind(this), this._isValueSuggestion.bind(this), customNumberHandler.bind(this))) |
| return true; |
| return false; |