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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js

Issue 2168713004: DevTools: Fix Ctrl-Z for source color picker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js
index eed8305089dc0111298b341d1f0336bf5e72e543..9d07485c0f8827f00db0503b340b0e0683526d6d 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js
@@ -187,6 +187,7 @@ WebInspector.CSSSourceFrame.prototype = {
}
this._currentSwatch = swatch;
this._currentColorPosition = colorPosition;
+ this.textEditor.setSelection(WebInspector.TextRange.createFromLocation(colorPosition.textRange.startLine, colorPosition.textRange.startColumn));
this._spectrum = new WebInspector.Spectrum();
this._spectrum.setColor(swatch.color(), swatch.format());
this._spectrum.addEventListener(WebInspector.Spectrum.Events.SizeChanged, this._spectrumResized, this);
@@ -210,7 +211,7 @@ WebInspector.CSSSourceFrame.prototype = {
this._muteColorProcessing = true;
var colorString = /** @type {string} */ (event.data);
this._currentSwatch.setColorText(colorString);
- this._textEditor.editRange(this._currentColorPosition.textRange, colorString);
+ this._textEditor.editRange(this._currentColorPosition.textRange, colorString, "*color-text-changed");
lushnikov 2016/07/21 17:55:39 what is "*" in the beginning? Can me remove it unl
flandy 2016/07/21 18:00:52 The star is necessary as it is used by CodeMirror
flandy 2016/07/21 20:01:51 *change history event
this._currentColorPosition.color = WebInspector.Color.parse(colorString);
this._currentColorPosition.textRange.endColumn = this._currentColorPosition.textRange.startColumn + colorString.length;
},
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698