DevTools: initialize "format script" button with current UISourceCode

As of today, the "format script" button is initialized as hidden and
will update its state in response to editorSelected event. However,
in case the event is sent prior to button construction, it should be
initialized with current selected editor.

BUG=424089
R=vsevik

Review URL: https://codereview.chromium.org/658293003

git-svn-id: svn://svn.chromium.org/blink/trunk@183881 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent cc6d6108
...@@ -231,7 +231,7 @@ WebInspector.ScriptFormatterEditorAction.prototype = { ...@@ -231,7 +231,7 @@ WebInspector.ScriptFormatterEditorAction.prototype = {
this._button = new WebInspector.StatusBarButton(WebInspector.UIString("Pretty print"), "sources-toggle-pretty-print-status-bar-item"); this._button = new WebInspector.StatusBarButton(WebInspector.UIString("Pretty print"), "sources-toggle-pretty-print-status-bar-item");
this._button.toggled = false; this._button.toggled = false;
this._button.addEventListener("click", this._toggleFormatScriptSource, this); this._button.addEventListener("click", this._toggleFormatScriptSource, this);
this._updateButton(null); this._updateButton(sourcesView.currentUISourceCode());
return this._button.element; return this._button.element;
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment