diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-03-05 00:35:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-05 00:35:56 +0100 |
commit | de97f5dd8e9dda4f86296cf829a82cd1d5f59467 (patch) | |
tree | 7e1a87b496f8b151e6c07b50301b5c1dedfb63db /devtools/client | |
parent | b9b17570065273fe3e023a8c8633188379ad6603 (diff) | |
parent | d24b2d8a1d04c4f1770f090c2eb26010d5e97a0d (diff) | |
download | UXP-de97f5dd8e9dda4f86296cf829a82cd1d5f59467.tar UXP-de97f5dd8e9dda4f86296cf829a82cd1d5f59467.tar.gz UXP-de97f5dd8e9dda4f86296cf829a82cd1d5f59467.tar.lz UXP-de97f5dd8e9dda4f86296cf829a82cd1d5f59467.tar.xz UXP-de97f5dd8e9dda4f86296cf829a82cd1d5f59467.zip |
Merge pull request #47 from janekptacijarabaci/devtools_storage_refresh_1
Added a button to refresh the Storage Inspector display
Diffstat (limited to 'devtools/client')
-rw-r--r-- | devtools/client/storage/storage.xul | 2 | ||||
-rw-r--r-- | devtools/client/storage/ui.js | 12 | ||||
-rw-r--r-- | devtools/client/themes/images/reload.svg | 5 | ||||
-rw-r--r-- | devtools/client/themes/storage.css | 6 |
4 files changed, 23 insertions, 2 deletions
diff --git a/devtools/client/storage/storage.xul b/devtools/client/storage/storage.xul index a91900add..fa006ac7c 100644 --- a/devtools/client/storage/storage.xul +++ b/devtools/client/storage/storage.xul @@ -48,6 +48,8 @@ <hbox id="storage-toolbar" class="devtools-toolbar"> <button id="add-button" class="devtools-button add-button"></button> + <button id="refresh-button" + class="devtools-button refresh-button"></button> <spacer flex="1"/> <textbox id="storage-searchbox" class="devtools-filterinput" diff --git a/devtools/client/storage/ui.js b/devtools/client/storage/ui.js index ef07a8e88..7745c8da9 100644 --- a/devtools/client/storage/ui.js +++ b/devtools/client/storage/ui.js @@ -160,6 +160,7 @@ function StorageUI(front, target, panelWin, toolbox) { this._tablePopup = this._panelDoc.getElementById("storage-table-popup"); this._tablePopup.addEventListener("popupshowing", this.onTablePopupShowing); + this.onRefreshTable = this.onRefreshTable.bind(this); this.onAddItem = this.onAddItem.bind(this); this.onRemoveItem = this.onRemoveItem.bind(this); this.onRemoveAllFrom = this.onRemoveAllFrom.bind(this); @@ -167,6 +168,9 @@ function StorageUI(front, target, panelWin, toolbox) { this.onRemoveAllSessionCookies = this.onRemoveAllSessionCookies.bind(this); this.onRemoveTreeItem = this.onRemoveTreeItem.bind(this); + this._refreshButton = this._panelDoc.getElementById("refresh-button"); + this._refreshButton.addEventListener("command", this.onRefreshTable); + this._addButton = this._panelDoc.getElementById("add-button"); this._addButton.addEventListener("command", this.onAddItem); @@ -229,6 +233,7 @@ StorageUI.prototype = { this.searchBox = null; this._treePopup.removeEventListener("popupshowing", this.onTreePopupShowing); + this._refreshButton.removeEventListener("command", this.onRefreshTable); this._addButton.removeEventListener("command", this.onAddItem); this._tablePopupAddItem.removeEventListener("command", this.onAddItem); this._treePopupDeleteAll.removeEventListener("command", this.onRemoveAll); @@ -1121,6 +1126,13 @@ StorageUI.prototype = { }, /** + * Handles refreshing the selected storage + */ + onRefreshTable: function (event) { + this.onHostSelect(event, this.tree.selectedItem); + }, + + /** * Handles adding an item from the storage */ onAddItem: function () { diff --git a/devtools/client/themes/images/reload.svg b/devtools/client/themes/images/reload.svg index b04262784..c5d9bf991 100644 --- a/devtools/client/themes/images/reload.svg +++ b/devtools/client/themes/images/reload.svg @@ -1,6 +1,7 @@ <!-- This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"> - <path d="M12,7H6l2.4-2.4C7.6,4,6.6,3.8,5.5,4.1C4.3,4.5,3.3,5.5,3,6.8 C2.6,9,4.3,11,6.5,11c1,0,2-0.5,2.6-1.2l1.7,1c-1.3,1.6-3.3,2.5-5.6,2c-2-0.5-3.6-2.1-4-4.1C0.4,5.1,3.1,2,6.5,2 c1.3,0,2.4,0.4,3.3,1.2L12,1V7z"/> +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> + <path d="M13.917 7C13.44 4.162 10.973 2 8 2 4.686 2 2 4.686 2 8s2.686 6 6 6c2.22 0 4.16-1.207 5.197-3H12c-.912 1.214-2.364 2-4 2-2.76 0-5-2.24-5-5s2.24-5 5-5c2.42 0 4.437 1.718 4.9 4h1.017z"/> + <path d="M14 1L8 7h6V1zm-1 1L9 6h4V2z" fill-rule="evenodd"/> </svg> diff --git a/devtools/client/themes/storage.css b/devtools/client/themes/storage.css index 1d4da9bd6..314b6b7fe 100644 --- a/devtools/client/themes/storage.css +++ b/devtools/client/themes/storage.css @@ -38,6 +38,12 @@ -moz-user-focus: normal; } +#storage-toolbar .refresh-button::before { + margin: 0; + background-image: url("chrome://devtools/skin/images/reload.svg"); + -moz-user-focus: normal; +} + #storage-toolbar .devtools-button { min-width: unset; } |