Commit f8044cca authored by pfeldman@chromium.org's avatar pfeldman@chromium.org

Web Inspector: remember the last dock option so that user could toggle between...

Web Inspector: remember the last dock option so that user could toggle between dock to bottom and right
https://bugs.webkit.org/show_bug.cgi?id=98255

Reviewed by Vsevolod Vlasov.

- Introduced DockController.js that covers the dock mechanics
- Removed dock orientation from the settings
- Storing the last dock option to present it as default
- Simplified the multi-option status bar button

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/compile-front-end.py:
* inspector/front-end/DockController.js: Added.
(WebInspector.DockController):
(WebInspector.DockController.prototype.get element):
(WebInspector.DockController.prototype.setDocked.set if):
(WebInspector.DockController.prototype.setDocked):
(WebInspector.DockController.prototype.setDockingUnavailable):
(WebInspector.DockController.prototype._updateUI.get states):
(WebInspector.DockController.prototype._updateUI):
(WebInspector.DockController.prototype._decorateButtonForTargetState):
(WebInspector.DockController.prototype._createDockOptions):
(WebInspector.DockController.prototype._toggleDockState):
(WebInspector.DockController.prototype.isCompactMode):
(WebInspector.DockController.prototype.setCompactMode):
* inspector/front-end/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setAttachedWindow):
* inspector/front-end/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub.prototype.requestAttachWindow):
(.WebInspector.InspectorFrontendHostStub.prototype.requestDetachWindow):
* inspector/front-end/Settings.js:
* inspector/front-end/SettingsScreen.js:
(WebInspector.GenericSettingsTab):
* inspector/front-end/StatusBarButton.js:
(WebInspector.StatusBarButton):
* inspector/front-end/Toolbar.js:
(WebInspector.Toolbar):
(WebInspector.Toolbar.prototype.setCompactMode):
(WebInspector.Toolbar.prototype._toolbarDragStart):
(WebInspector.Toolbar.prototype._toolbarDrag):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/externs.js:
(WebInspector.toggleSearchingForNode):
* inspector/front-end/inspector.css:
(body.undocked.platform-mac-snowleopard #toolbar):
(body.undocked.platform-mac-snowleopard #toolbar-dropdown):
* inspector/front-end/inspector.html:
* inspector/front-end/inspector.js:
(WebInspector._createGlobalStatusBarItems):
(windowLoaded):
(WebInspector.setDockingUnavailable):
* inspector/front-end/inspectorCommon.css:
(body.dock-to-right:not(.undocked)):
(body.dock-to-right.inactive:not(.undocked)):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1a6d5b21
2012-10-03 Pavel Feldman <pfeldman@chromium.org>
Web Inspector: remember the last dock option so that user could toggle between dock to bottom and right
https://bugs.webkit.org/show_bug.cgi?id=98255
Reviewed by Vsevolod Vlasov.
- Introduced DockController.js that covers the dock mechanics
- Removed dock orientation from the settings
- Storing the last dock option to present it as default
- Simplified the multi-option status bar button
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/compile-front-end.py:
* inspector/front-end/DockController.js: Added.
(WebInspector.DockController):
(WebInspector.DockController.prototype.get element):
(WebInspector.DockController.prototype.setDocked.set if):
(WebInspector.DockController.prototype.setDocked):
(WebInspector.DockController.prototype.setDockingUnavailable):
(WebInspector.DockController.prototype._updateUI.get states):
(WebInspector.DockController.prototype._updateUI):
(WebInspector.DockController.prototype._decorateButtonForTargetState):
(WebInspector.DockController.prototype._createDockOptions):
(WebInspector.DockController.prototype._toggleDockState):
(WebInspector.DockController.prototype.isCompactMode):
(WebInspector.DockController.prototype.setCompactMode):
* inspector/front-end/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setAttachedWindow):
* inspector/front-end/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub.prototype.requestAttachWindow):
(.WebInspector.InspectorFrontendHostStub.prototype.requestDetachWindow):
* inspector/front-end/Settings.js:
* inspector/front-end/SettingsScreen.js:
(WebInspector.GenericSettingsTab):
* inspector/front-end/StatusBarButton.js:
(WebInspector.StatusBarButton):
* inspector/front-end/Toolbar.js:
(WebInspector.Toolbar):
(WebInspector.Toolbar.prototype.setCompactMode):
(WebInspector.Toolbar.prototype._toolbarDragStart):
(WebInspector.Toolbar.prototype._toolbarDrag):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/externs.js:
(WebInspector.toggleSearchingForNode):
* inspector/front-end/inspector.css:
(body.undocked.platform-mac-snowleopard #toolbar):
(body.undocked.platform-mac-snowleopard #toolbar-dropdown):
* inspector/front-end/inspector.html:
* inspector/front-end/inspector.js:
(WebInspector._createGlobalStatusBarItems):
(windowLoaded):
(WebInspector.setDockingUnavailable):
* inspector/front-end/inspectorCommon.css:
(body.dock-to-right:not(.undocked)):
(body.dock-to-right.inactive:not(.undocked)):
2012-10-03 Vsevolod Vlasov <vsevik@chromium.org>
Web Inspector: UISourceCode commitWorkingCopy should not fail when original script had syntax error.
......
......@@ -6347,6 +6347,7 @@
'inspector/front-end/DOMPresentationUtils.js',
'inspector/front-end/DOMStorage.js',
'inspector/front-end/DOMSyntaxHighlighter.js',
'inspector/front-end/DockController.js',
'inspector/front-end/Drawer.js',
'inspector/front-end/ElementsPanelDescriptor.js',
'inspector/front-end/ElementsTreeOutline.js',
......
......@@ -76261,6 +76261,10 @@
RelativePath="..\inspector\front-end\DOMSyntaxHighlighter.js"
>
</File>
<File
RelativePath="..\inspector\front-end\DockController.js"
>
</File>
<File
RelativePath="..\inspector\front-end\Drawer.js"
>
......@@ -340,9 +340,17 @@ modules = [
"name": "host_stub",
"dependencies": ["ui"],
"sources": [
"InspectorFrontendAPI.js",
"InspectorFrontendHostStub.js",
]
},
{
"name": "inspector",
"dependencies": ["components"],
"sources": [
"DockController.js",
]
},
]
modules_by_name = {}
......
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @constructor
*/
WebInspector.DockController = function()
{
this._dockToggleButton = new WebInspector.StatusBarButton("", "dock-status-bar-item", 3);
this._dockToggleButtonOption = new WebInspector.StatusBarButton("", "dock-status-bar-item", 3);
this._dockToggleButton.addEventListener("click", this._toggleDockState, this);
this._dockToggleButtonOption.addEventListener("click", this._toggleDockState, this);
if (Preferences.showDockToRight)
this._dockToggleButton.makeLongClickEnabled(this._createDockOptions.bind(this));
this._dockSide = WebInspector.queryParamsObject["dockSide"];
this._innerSetDocked(WebInspector.queryParamsObject["docked"] === "true");
}
WebInspector.DockController.State = {
DockedToBottom: "bottom",
DockedToRight: "right",
Undocked: "undocked"
}
WebInspector.DockController.prototype = {
/**
* @return {Element}
*/
get element()
{
return this._dockToggleButton.element;
},
/**
* @param {boolean} docked
*/
setDocked: function(docked)
{
var isDocked = this._state !== WebInspector.DockController.State.Undocked;
if (docked !== isDocked)
this._innerSetDocked(docked);
},
/**
* @param {boolean} docked
*/
_innerSetDocked: function(docked)
{
if (this._state)
WebInspector.settings.lastDockState.set(this._state);
if (!docked) {
this._state = WebInspector.DockController.State.Undocked;
WebInspector.userMetrics.WindowDocked.record();
} else if (this._dockSide === "right") {
this._state = WebInspector.DockController.State.DockedToRight;
WebInspector.userMetrics.WindowUndocked.record();
} else {
this._state = WebInspector.DockController.State.DockedToBottom;
WebInspector.userMetrics.WindowUndocked.record();
}
this._updateUI();
},
/**
* @param {boolean} unavailable
*/
setDockingUnavailable: function(unavailable)
{
this._isDockingUnavailable = unavailable;
this._updateUI();
},
_updateUI: function()
{
var body = document.body;
switch (this._state) {
case WebInspector.DockController.State.DockedToBottom:
body.removeStyleClass("undocked");
body.removeStyleClass("dock-to-right");
this.setCompactMode(true);
break;
case WebInspector.DockController.State.DockedToRight:
body.removeStyleClass("undocked");
body.addStyleClass("dock-to-right");
this.setCompactMode(false);
break;
case WebInspector.DockController.State.Undocked:
body.addStyleClass("undocked");
body.removeStyleClass("dock-to-right");
this.setCompactMode(false);
break;
}
if (this._isDockingUnavailable) {
this._dockToggleButton.state = "undock";
this._dockToggleButton.disabled = true;
return;
}
this._dockToggleButton.disabled = false;
// Choose different last state based on the current one if missing or if is the same.
var states = [WebInspector.DockController.State.DockedToBottom, WebInspector.DockController.State.Undocked, WebInspector.DockController.State.DockedToRight];
states.remove(this._state);
var lastState = WebInspector.settings.lastDockState.get();
states.remove(lastState);
if (states.length === 2) { // last state was not from the list of potential values
lastState = states[0];
states.remove(lastState);
}
this._decorateButtonForTargetState(this._dockToggleButton, lastState);
this._decorateButtonForTargetState(this._dockToggleButtonOption, states[0]);
},
/**
* @param {WebInspector.StatusBarButton} button
* @param {number} state
*/
_decorateButtonForTargetState: function(button, state)
{
switch (state) {
case WebInspector.DockController.State.DockedToBottom:
button.title = WebInspector.UIString("Dock to main window.");
button.state = "bottom";
break;
case WebInspector.DockController.State.DockedToRight:
button.title = WebInspector.UIString("Dock to main window.");
button.state = "right";
break;
case WebInspector.DockController.State.Undocked:
button.title = WebInspector.UIString("Undock into separate window.");
button.state = "undock";
break;
}
},
_createDockOptions: function()
{
return [this._dockToggleButtonOption];
},
/**
* @param {WebInspector.Event} e
*/
_toggleDockState: function(e)
{
var state = e.target.state;
switch (state) {
case "undock":
InspectorFrontendHost.requestDetachWindow();
WebInspector.userMetrics.WindowUndocked.record();
break;
case "right":
case "bottom":
this._dockSide = state;
InspectorFrontendHost.requestSetDockSide(this._dockSide);
if (this._state === WebInspector.DockController.State.Undocked)
InspectorFrontendHost.requestAttachWindow();
else
this._innerSetDocked(true);
break;
}
},
/**
* @return {boolean}
*/
isCompactMode: function()
{
return this._isCompactMode;
},
/**
* @param {boolean} isCompactMode
*/
setCompactMode: function(isCompactMode)
{
var body = document.body;
this._isCompactMode = isCompactMode;
if (WebInspector.toolbar)
WebInspector.toolbar.setCompactMode(isCompactMode);
if (isCompactMode)
body.addStyleClass("compact");
else
body.removeStyleClass("compact");
}
}
......@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
InspectorFrontendAPI = {
var InspectorFrontendAPI = {
_pendingCommands: [],
isDebuggingEnabled: function()
......@@ -76,7 +76,8 @@ InspectorFrontendAPI = {
setAttachedWindow: function(attached)
{
WebInspector.attached = attached;
if (WebInspector.dockController)
WebInspector.dockController.setDocked(attached);
},
showConsole: function()
......
......@@ -70,10 +70,12 @@ WebInspector.InspectorFrontendHostStub.prototype = {
requestAttachWindow: function()
{
InspectorFrontendAPI.setAttachedWindow(true);
},
requestDetachWindow: function()
{
InspectorFrontendAPI.setAttachedWindow(false);
},
requestSetDockSide: function()
......
......@@ -92,7 +92,6 @@ WebInspector.Settings = function()
this.deviceMetrics = this.createSetting("deviceMetrics", "");
this.deviceFitWindow = this.createSetting("deviceFitWindow", false);
this.showScriptFolders = this.createSetting("showScriptFolders", true);
this.dockToRight = this.createSetting("dockToRight", false);
this.emulateTouchEvents = this.createSetting("emulateTouchEvents", false);
this.showPaintRects = this.createSetting("showPaintRects", false);
this.showShadowDOM = this.createSetting("showShadowDOM", false);
......@@ -104,6 +103,7 @@ WebInspector.Settings = function()
this.showHeapSnapshotObjectsHiddenProperties = this.createSetting("showHeaSnapshotObjectsHiddenProperties", false);
this.searchInContentScripts = this.createSetting("searchInContentScripts", false);
this.textEditorIndent = this.createSetting("textEditorIndent", " ");
this.lastDockState = this.createSetting("lastDockState", "");
// If there are too many breakpoints in a storage, it is likely due to a recent bug that caused
// periodical breakpoints duplication leading to inspector slowness.
......
......@@ -250,8 +250,6 @@ WebInspector.GenericSettingsTab = function()
WebInspector.SettingsTab.call(this);
var p = this._appendSection();
if (Preferences.showDockToRight)
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Dock to right"), WebInspector.settings.dockToRight));
if (Preferences.exposeDisableCache)
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Disable cache"), WebInspector.settings.cacheDisabled));
var disableJSElement = this._createCheckboxSetting(WebInspector.UIString("Disable JavaScript"), WebInspector.settings.javaScriptDisabled);
......
......@@ -57,6 +57,7 @@ WebInspector.StatusBarButton = function(title, className, states)
this._state = 0;
this.title = title;
this.className = className;
this.disabled = false;
this._visible = true;
}
......@@ -192,6 +193,10 @@ WebInspector.StatusBarButton.prototype = {
_showOptions: function(buttonsProvider)
{
var buttons = buttonsProvider();
var mainButtonClone = new WebInspector.StatusBarButton(this.title, this.className, this.states);
mainButtonClone.addEventListener("click", this._clicked, this);
mainButtonClone.state = this.state;
buttons.push(mainButtonClone);
var mouseUpListener = mouseUp.bind(this);
document.documentElement.addEventListener("mouseup", mouseUpListener, false);
......@@ -205,8 +210,8 @@ WebInspector.StatusBarButton.prototype = {
var boundMouseOver = mouseOver.bind(this);
var boundMouseOut = mouseOut.bind(this);
for (var i = 0; i < buttons.length; ++i) {
buttons[i].element.addEventListener("mousemove", boundMouseOver.bind(this), false);
buttons[i].element.addEventListener("mouseout", boundMouseOut.bind(this), false);
buttons[i].element.addEventListener("mousemove", boundMouseOver, false);
buttons[i].element.addEventListener("mouseout", boundMouseOut, false);
optionsBarElement.appendChild(buttons[i].element);
}
buttons[buttons.length - 1].element.addStyleClass("emulate-active");
......
......@@ -35,7 +35,7 @@
WebInspector.Toolbar = function()
{
this.element = document.getElementById("toolbar");
WebInspector.installDragHandle(this.element, this._toolbarDragStart.bind(this), this._toolbarDrag.bind(this), this._toolbarDragEnd.bind(this), (WebInspector.isCompactMode() ? "row-resize" : "default"));
WebInspector.installDragHandle(this.element, this._toolbarDragStart.bind(this), this._toolbarDrag.bind(this), this._toolbarDragEnd.bind(this), "default");
this._dropdownButton = document.getElementById("toolbar-dropdown-arrow");
this._dropdownButton.addEventListener("click", this._toggleDropdown.bind(this), false);
......@@ -96,12 +96,20 @@ WebInspector.Toolbar.prototype = {
return toolbarItem;
},
/**
* @param {boolean} isCompactMode
*/
setCompactMode: function(isCompactMode)
{
this._isCompactMode = isCompactMode;
},
/**
* @return {boolean}
*/
_toolbarDragStart: function(event)
{
if ((!WebInspector.isCompactMode() && WebInspector.platformFlavor() !== WebInspector.PlatformFlavor.MacLeopard && WebInspector.platformFlavor() !== WebInspector.PlatformFlavor.MacSnowLeopard) || WebInspector.port() == "qt")
if ((!this._isCompactMode && WebInspector.platformFlavor() !== WebInspector.PlatformFlavor.MacLeopard && WebInspector.platformFlavor() !== WebInspector.PlatformFlavor.MacSnowLeopard) || WebInspector.port() == "qt")
return false;
var target = event.target;
......@@ -124,7 +132,7 @@ WebInspector.Toolbar.prototype = {
_toolbarDrag: function(event)
{
if (WebInspector.isCompactMode()) {
if (this._isCompactMode) {
var height = window.innerHeight - (event.screenY - this.element.lastScreenY);
InspectorFrontendHost.setAttachedWindowHeight(height);
......
......@@ -58,6 +58,7 @@
<file>DOMStorage.js</file>
<file>DOMStorageItemsView.js</file>
<file>DOMSyntaxHighlighter.js</file>
<file>DockController.js</file>
<file>Drawer.js</file>
<file>ElementsPanel.js</file>
<file>ElementsPanelDescriptor.js</file>
......
......@@ -177,6 +177,8 @@ SourceMapV3.Offset = function()
// FIXME: remove everything below.
var WebInspector = {}
WebInspector.queryParamsObject = {}
WebInspector.toggleSearchingForNode = function() {}
WebInspector.panels = {};
/**
......@@ -263,8 +265,6 @@ WebInspector.showPanel = function(panel)
*/
WebInspector.inspectedPageDomain;
WebInspector.isCompactMode = function() { return false; }
WebInspector.SourceJavaScriptTokenizer = {}
WebInspector.SourceJavaScriptTokenizer.Keywords = {}
......
......@@ -66,8 +66,8 @@ body.inactive #toolbar {
border-bottom: 1px solid rgb(64%, 64%, 64%);
}
body.detached.platform-mac-leopard #toolbar,
body.detached.platform-mac-snowleopard #toolbar {
body.undocked.platform-mac-leopard #toolbar,
body.undocked.platform-mac-snowleopard #toolbar {
background: transparent;
}
......@@ -194,8 +194,8 @@ body.compact #toolbar-dropdown-arrow {
background-image: inherit;
}
body.detached.platform-mac-leopard #toolbar-dropdown,
body.detached.platform-mac-snowleopard #toolbar-dropdown {
body.undocked.platform-mac-leopard #toolbar-dropdown,
body.undocked.platform-mac-snowleopard #toolbar-dropdown {
background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(191, 191, 191)), to(rgb(151, 151, 151)));
}
......
......@@ -167,8 +167,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="ElementsPanelDescriptor.js"></script>
<script type="text/javascript" src="NetworkPanelDescriptor.js"></script>
<script type="text/javascript" src="ScriptsPanelDescriptor.js"></script>
<script type="text/javascript" src="DockController.js"></script>
</head>
<body class="detached" id="-webkit-web-inspector">
<body class="undocked" id="-webkit-web-inspector">
<div id="toolbar">
<div class="toolbar-item close-left"><button id="close-button-left"></button></div>
<div id="toolbar-controls">
......
......@@ -72,13 +72,10 @@ var WebInspector = {
_createGlobalStatusBarItems: function()
{
var bottomStatusBarContainer = document.getElementById("bottom-status-bar-container");
this._dockToggleButton = new WebInspector.StatusBarButton("", "dock-status-bar-item", 3);
this._dockToggleButton.makeLongClickEnabled(this._createDockOptions.bind(this));
this._dockToggleButton.addEventListener("click", this._toggleAttach.bind(this), false);
this._updateDockButtonState();
// Create main dock button and options.
var mainStatusBar = document.getElementById("main-status-bar");
mainStatusBar.insertBefore(this._dockToggleButton.element, bottomStatusBarContainer);
mainStatusBar.insertBefore(this.dockController.element, bottomStatusBarContainer);
this._toggleConsoleButton = new WebInspector.StatusBarButton(WebInspector.UIString("Show console."), "console-status-bar-item");
this._toggleConsoleButton.addEventListener("click", this._toggleConsoleButtonClicked.bind(this), false);
......@@ -93,68 +90,6 @@ var WebInspector = {
mainStatusBar.appendChild(this.settingsController.statusBarItem);
},
_createDockOptions: function()
{
var alternateDockToggleButton1 = new WebInspector.StatusBarButton("Dock to main window.", "dock-status-bar-item", 3);
var alternateDockToggleButton2 = new WebInspector.StatusBarButton("Undock into separate window.", "dock-status-bar-item", 3);
if (this.attached) {
alternateDockToggleButton1.state = WebInspector.settings.dockToRight.get() ? "bottom" : "right";
alternateDockToggleButton2.state = "undock";
} else {
alternateDockToggleButton1.state = WebInspector.settings.dockToRight.get() ? "bottom" : "right";
alternateDockToggleButton2.state = WebInspector.settings.dockToRight.get() ? "right" : "bottom";
}
alternateDockToggleButton1.addEventListener("click", onClick.bind(this), false);
alternateDockToggleButton2.addEventListener("click", onClick.bind(this), false);
function onClick(e)
{
var state = e.target.state;
if (state === "undock")
this._toggleAttach();
else if (state === "right") {
if (!this.attached)
this._toggleAttach();
WebInspector.settings.dockToRight.set(true);
} else if (state === "bottom") {
if (!this.attached)
this._toggleAttach();
WebInspector.settings.dockToRight.set(false);
}
}
return [alternateDockToggleButton1, alternateDockToggleButton2];
},
_updateDockButtonState: function()
{
if (!this._dockToggleButton)
return;
if (this.attached) {
this._dockToggleButton.disabled = false;
this._dockToggleButton.state = "undock";
this._dockToggleButton.title = WebInspector.UIString("Undock into separate window.");
} else {
this._dockToggleButton.disabled = this._isDockingUnavailable;
this._dockToggleButton.state = WebInspector.settings.dockToRight.get() ? "right" : "bottom";
this._dockToggleButton.title = WebInspector.UIString("Dock to main window.");
}
},
_toggleAttach: function()
{
if (!this._attached) {
InspectorFrontendHost.requestAttachWindow();
WebInspector.userMetrics.WindowDocked.record();
} else {
InspectorFrontendHost.requestDetachWindow();
WebInspector.userMetrics.WindowUndocked.record();
}
},
_toggleConsoleButtonClicked: function()
{
if (this._toggleConsoleButton.disabled)
......@@ -223,42 +158,6 @@ var WebInspector = {
}
},
get attached()
{
return this._attached;
},
set attached(x)
{
if (this._attached === x)
return;
this._attached = x;
if (x)
document.body.removeStyleClass("detached");