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

Unified Diff: third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js

Issue 2565113002: DevTools: update console viewport scroll when prompt is resized (Closed)
Patch Set: rebaseline Created 3 years, 8 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
Index: third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js b/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
index bf301bc2ae82a9f86048908c16272e7ff0558f7a..0c474fa7028305901ef1d2d2395fcac57975c53a 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
@@ -53,9 +53,12 @@ SourceFrame.SourceFrame = class extends UI.SimpleView {
SourceFrame.SourcesTextEditor.Events.EditorFocused, this._resetCurrentSearchResultIndex, this);
this._textEditor.addEventListener(
SourceFrame.SourcesTextEditor.Events.SelectionChanged, this._updateSourcePosition, this);
- this._textEditor.addEventListener(
- SourceFrame.SourcesTextEditor.Events.TextChanged,
- event => this.onTextChanged(event.data.oldRange, event.data.newRange));
+ this._textEditor.addEventListener(UI.TextEditor.Events.TextChanged, event => {
+ if (!this._muteChangeEventsForSetContent)
+ this.onTextChanged(event.data.oldRange, event.data.newRange);
+ });
+ /** @type {boolean|undefined} */
+ this._muteChangeEventsForSetContent;
this._shortcuts = {};
this.element.addEventListener('keydown', this._handleKeyDown.bind(this), false);
@@ -264,6 +267,7 @@ SourceFrame.SourceFrame = class extends UI.SimpleView {
* @param {?string} content
*/
setContent(content) {
+ this._muteChangeEventsForSetContent = true;
if (!this._loaded) {
this._loaded = true;
this._textEditor.setText(content || '');
@@ -284,6 +288,7 @@ SourceFrame.SourceFrame = class extends UI.SimpleView {
this._delayedFindSearchMatches();
delete this._delayedFindSearchMatches;
}
+ delete this._muteChangeEventsForSetContent;
this.onTextEditorContentSet();
}

Powered by Google App Engine
This is Rietveld 408576698