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

Improvement: Update thumbnails when url has changed

This commit is contained in:
MatMoul 2017-10-15 00:51:50 +02:00
parent 39f96b015b
commit 9c907f37e0

View File

@ -448,12 +448,14 @@ app.GridNodes.getNodeWithParents = function(id){
app.GridNodes.updateNode = function(gridNode, value, callback){ app.GridNodes.updateNode = function(gridNode, value, callback){
if(value){ if(value){
if(value.title) gridNode.title = value.title; if(value.title) gridNode.title = value.title;
if(gridNode.type == app.GridNodes.GridNodeType.bookmark && value.url && gridNode.url != value.url){
gridNode.url = value.url;
delete gridNode.image;
}
if(value.image) gridNode.image = value.image; if(value.image) gridNode.image = value.image;
else delete gridNode.image; else delete gridNode.image;
if(gridNode.type == app.GridNodes.GridNodeType.bookmark && value.url && gridNode.url != value.url){
gridNode.url = value.url;
app.GridNodes.refreshNode(gridNode, function(){
browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded });
});
}
app.GridNodes.saveNode(gridNode); app.GridNodes.saveNode(gridNode);
} }
if(callback) callback(gridNode); if(callback) callback(gridNode);