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

Bug: (Properties) Image is lost when clicking OK and Unlock title don't work

This commit is contained in:
MatMoul 2017-10-21 18:03:30 +02:00
parent cebdb32c35
commit 5e61b65e82
3 changed files with 11 additions and 7 deletions

View File

@ -461,7 +461,7 @@ app.GridNodes.getNodeWithParents = function(id){
app.GridNodes.updateNode = function(gridNode, value, callback){
if(value){
if(value.title) gridNode.title = value.title;
if(value.titleLocked) gridNode.titleLocked = value.titleLocked;
if(value.titleLocked!=null) gridNode.titleLocked = value.titleLocked;
if(value.image) gridNode.image = value.image;
else delete gridNode.image;
if(gridNode.type == app.GridNodes.GridNodeType.bookmark && value.url && gridNode.url != value.url){

View File

@ -354,8 +354,10 @@ dial.populateGrid = function(){
populateFolder = function(link, node){
link.Node = node;
link.className = 'Folder';
if(node.image) link.childNodes[0].style.backgroundImage = 'url(' + node.image + ')';
else link.childNodes[0].style.backgroundImage = '';
if(node.image){
if(node.image.indexOf('url(')>=0) link.childNodes[0].style.backgroundImage = node.image;
else link.childNodes[0].style.backgroundImage = 'url(' + node.image + ')';
} else link.childNodes[0].style.backgroundImage = '';
link.childNodes[1].innerText = node.title;
if(dial.path) link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(dial.path + node.title);
else link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(node.title);
@ -366,7 +368,8 @@ dial.populateGrid = function(){
link.Node = node;
if(node.image){
link.className = 'Bookmark';
link.childNodes[0].style.backgroundImage = 'url(' + node.image + ')';
if(node.image.indexOf('url(')>=0) link.childNodes[0].style.backgroundImage = node.image;
else link.childNodes[0].style.backgroundImage = 'url(' + node.image + ')';
} else {
link.className = 'BookmarkLoading';
link.childNodes[0].style.backgroundImage = '';

View File

@ -26,17 +26,18 @@ app.init = function(){
TitleLocked.parentNode.style.display = 'none';
Url.parentNode.parentNode.style.display = 'none';
if(node.image){
if(node.image.indexOf('url(')>0) Image = node.image;
if(node.image.indexOf('url(')>=0) Image = node.image;
else Image = 'url(' + node.image + ')';
} else Image = null;
if(Image==null) ImagePreview.style.backgroundImage = app.settings.grid.folderIcon;
else ImagePreview.style.backgroundImage = Image;
break;
case app.GridNodes.GridNodeType.bookmark:
TitleLocked.checked = node.titleLocked;
TitleLocked.checked = (node.titleLocked==true);
ImageDefault.style.display = 'none';
Url.value = node.url;
Image = 'url(' + node.image + ')';
if(node.image.indexOf('url(')>=0) Image = node.image;
else Image = 'url(' + node.image + ')';
ImagePreview.style.backgroundImage = Image;
break;
}