1
0
mirror of https://github.com/MatMoul/quickdial-webext.git synced 2024-12-23 07:26:11 +00:00

Bug: Settings page save problem

This commit is contained in:
MatMoul 2017-11-18 23:47:05 +01:00
parent 05a78e2d63
commit 190d54a0f1

View File

@ -539,24 +539,25 @@ app.GridNodes.updateNode = function(gridNode, value, callback){
gridNode.url = value.url;
app.GridNodes.refreshNode(gridNode, function(){
browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded });
app.GridNodes.saveNode(gridNode);
var data = { title: gridNode.title };
if(gridNode.imageMode) data.imageMode = gridNode.imageMode;
if(gridNode.type == app.GridNodes.GridNodeType.bookmark) data.url = gridNode.url;
//if(gridNode.imageMode) data.imageMode = gridNode.imageMode;
//if(gridNode.type == app.GridNodes.GridNodeType.bookmark) data.url = gridNode.url;
data.url = gridNode.url;
browser.bookmarks.onChanged.removeListener(app.Bookmarks._onChanged);
browser.bookmarks.update(gridNode.id, data).then(function(){
browser.bookmarks.onChanged.addListener(app.Bookmarks._onChanged);
});
app.GridNodes.saveNode(gridNode);
});
} else {
browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded });
app.GridNodes.saveNode(gridNode);
var data = { title: gridNode.title };
if(gridNode.imageMode) data.imageMode = gridNode.imageMode;
//if(gridNode.imageMode) data.imageMode = gridNode.imageMode;
browser.bookmarks.onChanged.removeListener(app.Bookmarks._onChanged);
browser.bookmarks.update(gridNode.id, data).then(function(){
browser.bookmarks.onChanged.addListener(app.Bookmarks._onChanged);
});
app.GridNodes.saveNode(gridNode);
}
}
if(callback) callback(gridNode);