summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js')
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js68
1 files changed, 2 insertions, 66 deletions
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js b/src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js
index 66b4a92..1aa11ee 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js
@@ -31,21 +31,7 @@ WebInspector.StoragePanel = function(database)
{
WebInspector.Panel.call(this);
- this.sidebarElement = document.createElement("div");
- this.sidebarElement.id = "storage-sidebar";
- this.sidebarElement.className = "sidebar";
- this.element.appendChild(this.sidebarElement);
-
- this.sidebarResizeElement = document.createElement("div");
- this.sidebarResizeElement.className = "sidebar-resizer-vertical";
- this.sidebarResizeElement.addEventListener("mousedown", this._startSidebarDragging.bind(this), false);
- this.element.appendChild(this.sidebarResizeElement);
-
- this.sidebarTreeElement = document.createElement("ol");
- this.sidebarTreeElement.className = "sidebar-tree";
- this.sidebarElement.appendChild(this.sidebarTreeElement);
-
- this.sidebarTree = new TreeOutline(this.sidebarTreeElement);
+ this.createSidebar();
this.databasesListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("DATABASES"), {}, true);
this.sidebarTree.appendChild(this.databasesListTreeElement);
@@ -86,12 +72,6 @@ WebInspector.StoragePanel.prototype = {
return [this.storageViewStatusBarItemsContainer];
},
- show: function()
- {
- WebInspector.Panel.prototype.show.call(this);
- this._updateSidebarWidth();
- },
-
reset: function()
{
if (this._databases) {
@@ -133,11 +113,6 @@ WebInspector.StoragePanel.prototype = {
this.sidebarTree.selectedTreeElement.deselect();
},
- handleKeyEvent: function(event)
- {
- this.sidebarTree.handleKeyEvent(event);
- },
-
addDatabase: function(database)
{
this._databases.push(database);
@@ -416,49 +391,10 @@ WebInspector.StoragePanel.prototype = {
return null;
},
- _startSidebarDragging: function(event)
- {
- WebInspector.elementDragStart(this.sidebarResizeElement, this._sidebarDragging.bind(this), this._endSidebarDragging.bind(this), event, "col-resize");
- },
-
- _sidebarDragging: function(event)
- {
- this._updateSidebarWidth(event.pageX);
-
- event.preventDefault();
- },
-
- _endSidebarDragging: function(event)
- {
- WebInspector.elementDragEnd(event);
- },
-
- _updateSidebarWidth: function(width)
+ updateMainViewWidth: function(width)
{
- if (this.sidebarElement.offsetWidth <= 0) {
- // The stylesheet hasn't loaded yet or the window is closed,
- // so we can't calculate what is need. Return early.
- return;
- }
-
- if (!("_currentSidebarWidth" in this))
- this._currentSidebarWidth = this.sidebarElement.offsetWidth;
-
- if (typeof width === "undefined")
- width = this._currentSidebarWidth;
-
- width = Number.constrain(width, Preferences.minSidebarWidth, window.innerWidth / 2);
-
- this._currentSidebarWidth = width;
-
- this.sidebarElement.style.width = width + "px";
this.storageViews.style.left = width + "px";
this.storageViewStatusBarItemsContainer.style.left = width + "px";
- this.sidebarResizeElement.style.left = (width - 3) + "px";
-
- var visibleView = this.visibleView;
- if (visibleView && "resize" in visibleView)
- visibleView.resize();
}
}