Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1122)

Side by Side Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 343343003: DevTools: [Styles] Add "px" suffix to numbers on arrow up/down (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove "border" and "outline" Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 3267 matching lines...) Expand 10 before | Expand all | Expand 10 after
3278 * @param {string} originalValue 3278 * @param {string} originalValue
3279 * @param {string} replacementString 3279 * @param {string} replacementString
3280 * @this {WebInspector.StylesSidebarPane.CSSPropertyPrompt} 3280 * @this {WebInspector.StylesSidebarPane.CSSPropertyPrompt}
3281 */ 3281 */
3282 function finishHandler(originalValue, replacementString) 3282 function finishHandler(originalValue, replacementString)
3283 { 3283 {
3284 // Synthesize property text disregarding any comments, custom whites pace etc. 3284 // Synthesize property text disregarding any comments, custom whites pace etc.
3285 this._sidebarPane.applyStyleText(this._sidebarPane.nameElement.textC ontent + ": " + this._sidebarPane.valueElement.textContent, false, false, false) ; 3285 this._sidebarPane.applyStyleText(this._sidebarPane.nameElement.textC ontent + ": " + this._sidebarPane.valueElement.textContent, false, false, false) ;
3286 } 3286 }
3287 3287
3288 /**
3289 * @param {string} prefix
3290 * @param {number} number
3291 * @param {string} suffix
3292 * @return {string}
3293 * @this {WebInspector.StylesSidebarPane.CSSPropertyPrompt}
3294 */
3295 function customNumberHandler(prefix, number, suffix)
3296 {
3297 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.
3298 suffix = "px";
3299 return prefix + number + suffix;
3300 }
3301
3288 // Handle numeric value increment/decrement only at this point. 3302 // Handle numeric value increment/decrement only at this point.
3289 if (!this._isEditingName && WebInspector.handleElementValueModifications (event, this._sidebarPane.valueElement, finishHandler.bind(this), this._isValueS uggestion.bind(this))) 3303 if (!this._isEditingName && WebInspector.handleElementValueModifications (event, this._sidebarPane.valueElement, finishHandler.bind(this), this._isValueS uggestion.bind(this), customNumberHandler.bind(this)))
3290 return true; 3304 return true;
3291 3305
3292 return false; 3306 return false;
3293 }, 3307 },
3294 3308
3295 /** 3309 /**
3296 * @param {string} word 3310 * @param {string} word
3297 * @return {boolean} 3311 * @return {boolean}
3298 */ 3312 */
3299 _isValueSuggestion: function(word) 3313 _isValueSuggestion: function(word)
(...skipping 18 matching lines...) Expand all
3318 return; 3332 return;
3319 } 3333 }
3320 3334
3321 var results = this._cssCompletions.startsWith(prefix); 3335 var results = this._cssCompletions.startsWith(prefix);
3322 var selectedIndex = this._cssCompletions.mostUsedOf(results); 3336 var selectedIndex = this._cssCompletions.mostUsedOf(results);
3323 completionsReadyCallback(results, selectedIndex); 3337 completionsReadyCallback(results, selectedIndex);
3324 }, 3338 },
3325 3339
3326 __proto__: WebInspector.TextPrompt.prototype 3340 __proto__: WebInspector.TextPrompt.prototype
3327 } 3341 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/MetricsSidebarPane.js ('k') | Source/devtools/front_end/sdk/CSSMetadata.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698