Skip to content

Commit 492cb67

Browse files
committed
Show header on options page only for tab mode
1 parent b7323fb commit 492cb67

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
lines changed

css/options.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,8 @@ body {
8888

8989
.b-options__button-save_animated {
9090
animation: changeBgc 2.7s;
91+
}
92+
93+
.b-container__main-header_hidden {
94+
display: none;
9195
}

js/options.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class Options {
66

77
init() {
88
this.selectElements();
9+
this.showHeader();
910
this.loadSettings();
1011
this.showSettings();
1112
this.startHandlers();
@@ -17,11 +18,21 @@ class Options {
1718
this.el = {
1819
storageSelect: qs('.js-select-storage'),
1920
themeSelect: qs('.js-select-theme'),
20-
saveBtn: qs('.js-save-button')
21+
saveBtn: qs('.js-save-button'),
22+
header: qs('.js-options-header')
2123
}
2224
}
2325

2426

27+
/**
28+
* Show main header if 'show_header' flag set in url
29+
*/
30+
showHeader() {
31+
if(window.location.search.includes('show_header')) {
32+
this.el.header.classList.remove('b-container__main-header_hidden');
33+
}
34+
}
35+
2536
/**
2637
* Load saved settings of set defaults instead
2738
*/

js/panel.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,7 @@ class WebStorageExplorer {
273273
e.preventDefault();
274274
this.el.showSubnavBtn.trigger(':hide');
275275

276-
if (chrome.runtime.openOptionsPage) {
277-
chrome.runtime.openOptionsPage();
278-
} else {
279-
// TODO remove when crbug.com/679167 will be resolved
280-
window.open(chrome.runtime.getURL('options.html'));
281-
}
276+
window.open(chrome.runtime.getURL('options.html?show_header'));
282277
});
283278

284279
// Open links from json view in a new tab

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 2,
33
"name": "Web Storage Explorer",
44
"short_name": "WebStorageX",
5-
"version": "1.0.2",
5+
"version": "1.0.3",
66
"minimum_chrome_version": "42",
77
"description": "Developer tool for exploring localStorage and sessionStorage which lets you parse values",
88
"author": "Deliaz",

options.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</head>
88
<body>
99
<div class="b-container">
10-
<h1 class="b-container__main-header">Web Storage Explorer options</h1>
10+
<h1 class="b-container__main-header b-container__main-header_hidden js-options-header">Web Storage Explorer options</h1>
1111

1212
<div class="b-options">
1313
<div class="b-options__setting">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chrome-webstorage-explorer",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "",
55
"main": "manifest.json",
66
"scripts": {

0 commit comments

Comments
 (0)