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

Improvement: Bookmarks sync

This commit is contained in:
MatMoul 2017-11-10 23:40:13 +01:00
parent 63c06fe5a5
commit 5e07132316

View File

@ -612,6 +612,12 @@ app.GridNodes.refreshNode = function(gridNode, callback){ // Refresh content of
delete gridNode.__isLoading; delete gridNode.__isLoading;
app.GridNodes.saveNode(gridNode); app.GridNodes.saveNode(gridNode);
if(callback) callback({ title: gridNode.title, screenshot: gridNode.image }); if(callback) callback({ title: gridNode.title, screenshot: gridNode.image });
/*
browser.bookmarks.onChanged.removeListener(app.Bookmarks._onChanged);
browser.bookmarks.update(gridNode.id, { title: gridNode.title }).then(function(){
browser.bookmarks.onChanged.addListener(app.Bookmarks._onChanged);
});
*/
break; break;
case app.GridNodes.GridNodeType.bookmark: case app.GridNodes.GridNodeType.bookmark:
app.SiteInfos.fromFrame(gridNode.url, function(infos){ app.SiteInfos.fromFrame(gridNode.url, function(infos){
@ -624,6 +630,10 @@ app.GridNodes.refreshNode = function(gridNode, callback){ // Refresh content of
delete gridNode.__isLoading; delete gridNode.__isLoading;
app.GridNodes.saveNode(gridNode); app.GridNodes.saveNode(gridNode);
if(callback) callback(infos); if(callback) callback(infos);
browser.bookmarks.onChanged.removeListener(app.Bookmarks._onChanged);
browser.bookmarks.update(gridNode.id, { title: gridNode.title, url: gridNode.url }).then(function(){
browser.bookmarks.onChanged.addListener(app.Bookmarks._onChanged);
});
}); });
break; break;
} }
@ -660,6 +670,10 @@ app.GridNodes.capturePage = function(gridNode, callback){
delete gridNode.__isLoading; delete gridNode.__isLoading;
app.GridNodes.saveNode(gridNode); app.GridNodes.saveNode(gridNode);
if(callback) callback(infos); if(callback) callback(infos);
browser.bookmarks.onChanged.removeListener(app.Bookmarks._onChanged);
browser.bookmarks.update(gridNode.id, { title: gridNode.title, url: gridNode.url }).then(function(){
browser.bookmarks.onChanged.addListener(app.Bookmarks._onChanged);
});
}); });
break; break;
} }