diff --git a/src/html/settings.html b/src/html/settings.html
index dc3b570..59d6b31 100644
--- a/src/html/settings.html
+++ b/src/html/settings.html
@@ -62,6 +62,14 @@
Show "Add to ..." : |
|
+
+
+ Open QD in new page : |
+ |
+
+
+
+
diff --git a/src/js/background.js b/src/js/background.js
index e2209f9..8ba2932 100644
--- a/src/js/background.js
+++ b/src/js/background.js
@@ -4,8 +4,9 @@ app.init = function(){ // Init module
app.Settings.init(function(){
app.Messages.init();
browser.runtime.sendMessage({ cmd: app.Messages.Commands.settingsChanged });
- browser.browserAction.onClicked.addListener(function(){
- browser.tabs.create({});
+ browser.browserAction.onClicked.addListener(function(e){
+ if(app.settings.openQuickDialInNewPage) browser.tabs.create({});
+ else browser.tabs.update(e.id, {url: '/dial'}).then();
});
app.GridNodes.sync(app.node, app.settings.grid.root, function(){
browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded });
@@ -109,6 +110,7 @@ app.Settings.init = function(callback){ // Load settings and nodes
backgroundImage: null,
backgroundMode: 0,
menuShowAdd: true,
+ openQuickDialInNewPage: true,
grid: {
margin: 10,
rows: 4,
@@ -222,6 +224,9 @@ app.Settings.init = function(callback){ // Load settings and nodes
data.settings.grid.openBookmarkMethod = 0;
data.settings.grid.openFolderMethod = 0;
}
+ if(!data.settings.openQuickDialInNewPage && data.settings.openQuickDialInNewPage != false){
+ data.settings.openQuickDialInNewPage = true;
+ }
//app.Settings.save();
}
app.settings = data.settings;
diff --git a/src/js/settings.js b/src/js/settings.js
index 58e0ffc..296d58b 100644
--- a/src/js/settings.js
+++ b/src/js/settings.js
@@ -27,6 +27,7 @@ app.init = function(){
BackgroundPreview.style.backgroundImage = app.settings.backgroundImage;
BackgroundPreview.style.backgroundRepeat = 'no-repeat';
BackgroundPreview.style.backgroundSize = '100% 100%';
+ ButtonOpenInNewPage.checked = app.settings.openQuickDialInNewPage;
GridRoot.value = app.settings.grid.root;
GridRows.value = app.settings.grid.rows;
GridRatioX.value = app.settings.grid.ratioX;
@@ -86,6 +87,7 @@ app.init = function(){
app.settings.backgroundColor = BackgroundColor.value;
app.settings.backgroundImage = BackgroundImage;
app.settings.backgroundMode = +(BackgroundMode.value);
+ app.settings.openQuickDialInNewPage = ButtonOpenInNewPage.checked;
app.settings.grid.rows = +(GridRows.value);
app.settings.grid.margin = +(GridMargins.value);
app.settings.grid.columns = +(GridColumns.value);