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

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

Issue 2342643002: DevTools: Don't refresh CodeMirror if it is hidden (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js b/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js
index ea0a246d9679cf435ad80d6bbe8eae53a0def339..7de9d34b38e691a9428053ee9700c563922749bd 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js
@@ -174,7 +174,7 @@ WebInspector.SourcesTextEditor.prototype = {
this._gutters.push(type);
this.codeMirror().setOption("gutters", this._gutters.slice());
- this.codeMirror().refresh();
+ this.refresh();
},
/**
@@ -182,9 +182,12 @@ WebInspector.SourcesTextEditor.prototype = {
*/
uninstallGutter: function(type)
{
+ var originalLength = this._gutters.length;
lushnikov 2016/09/14 19:02:35 indexOf..
this._gutters = this._gutters.filter(gutter => gutter !== type);
+ if (originalLength === this._gutters.length)
+ return;
this.codeMirror().setOption("gutters", this._gutters.slice());
- this.codeMirror().refresh();
+ this.refresh();
},
/**
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698