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

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

Issue 1824683002: Fixes 590477: Style pane numeric property change modifier shortcuts are undiscoverable. Shift mouse… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes 590477: Style pane numeric property change modifier shortcuts are undiscoverable. Shift mouse… Created 4 years, 7 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
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 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after
2843 */ 2843 */
2844 WebInspector.StylesSidebarPane.CSSPropertyPrompt = function(cssCompletions, tree Element, isEditingName) 2844 WebInspector.StylesSidebarPane.CSSPropertyPrompt = function(cssCompletions, tree Element, isEditingName)
2845 { 2845 {
2846 // Use the same callback both for applyItemCallback and acceptItemCallback. 2846 // Use the same callback both for applyItemCallback and acceptItemCallback.
2847 WebInspector.TextPrompt.call(this, this._buildPropertyCompletions.bind(this) , WebInspector.StyleValueDelimiters); 2847 WebInspector.TextPrompt.call(this, this._buildPropertyCompletions.bind(this) , WebInspector.StyleValueDelimiters);
2848 this.setSuggestBoxEnabled(true); 2848 this.setSuggestBoxEnabled(true);
2849 this._cssCompletions = cssCompletions; 2849 this._cssCompletions = cssCompletions;
2850 this._treeElement = treeElement; 2850 this._treeElement = treeElement;
2851 this._isEditingName = isEditingName; 2851 this._isEditingName = isEditingName;
2852 2852
2853 if (!isEditingName) 2853 if (!isEditingName) {
2854 this.disableDefaultSuggestionForEmptyInput(); 2854 this.disableDefaultSuggestionForEmptyInput();
2855
2856 // If a CSS value is being edited that has a numeric or hex substring, h int that precision modifier shortcuts are available.
2857 if (treeElement && treeElement.valueElement) {
2858 var cssValueText = treeElement.valueElement.textContent;
2859 if (cssValueText.match(/#[\da-f]{3,6}$/i))
2860 this.setTitle(WebInspector.UIString("Increment/decrement with mo usewheel or up/down keys. %s: R ±1, Shift: G ±1, Alt: B ±1", WebInspector.isMac( ) ? "Cmd" : "Ctrl"));
2861 else if (cssValueText.match(/\d+/))
2862 this.setTitle(WebInspector.UIString("Increment/decrement with mo usewheel or up/down keys. %s: ±100, Shift: ±10, Alt: ±0.1", WebInspector.isMac() ? "Cmd" : "Ctrl"));
2863 }
2864
2865 }
2855 } 2866 }
2856 2867
2857 WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = { 2868 WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = {
2858 /** 2869 /**
2859 * @override 2870 * @override
2860 * @param {!Event} event 2871 * @param {!Event} event
2861 */ 2872 */
2862 onKeyDown: function(event) 2873 onKeyDown: function(event)
2863 { 2874 {
2864 switch (event.keyIdentifier) { 2875 switch (event.keyIdentifier) {
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
3112 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha nged); 3123 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha nged);
3113 onNodeChanged(); 3124 onNodeChanged();
3114 return button; 3125 return button;
3115 3126
3116 function onNodeChanged() 3127 function onNodeChanged()
3117 { 3128 {
3118 var node = WebInspector.context.flavor(WebInspector.DOMNode); 3129 var node = WebInspector.context.flavor(WebInspector.DOMNode);
3119 button.setEnabled(!!node); 3130 button.setEnabled(!!node);
3120 } 3131 }
3121 } 3132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698