1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 15:25:59 +00:00

various icon updates; use new icons in feed tree

This commit is contained in:
Andrew Dolgov
2018-12-05 20:26:27 +03:00
parent aff76584c8
commit cad6d1d7fd
11 changed files with 176 additions and 47 deletions

View File

@@ -8,14 +8,27 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"],
_createTreeNode: function(args) {
const tnode = new dijit._TreeNode(args);
const icon = dojo.doc.createElement('img');
if (args.item.icon && args.item.icon[0]) {
icon.src = args.item.icon[0];
} else {
icon.src = 'images/blank_icon.gif';
const iconName = args.item.icon ? String(args.item.icon[0]) : null;
let iconNode;
if (iconName) {
if (iconName.indexOf("/") == -1) {
iconNode = dojo.doc.createElement("i");
iconNode.className = "material-icons icon icon-" + iconName;
iconNode.innerHTML = iconName;
} else {
iconNode = dojo.doc.createElement('img');
if (args.item.icon && args.item.icon[0]) {
iconNode.src = args.item.icon[0];
} else {
iconNode.src = 'images/blank_icon.gif';
}
iconNode.className = 'icon';
}
}
icon.className = 'tinyFeedIcon';
domConstruct.place(icon, tnode.iconNode, 'only');
if (iconNode)
domConstruct.place(iconNode, tnode.iconNode, 'only');
const id = args.item.id[0];
const bare_id = parseInt(id.substr(id.indexOf(':')+1));
@@ -161,7 +174,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"],
return "";
},
getIconClass: function (item, opened) {
return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "feedIcon";
return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "feed-icon";
},
getLabelClass: function (item, opened) {
return (item.unread == 0) ? "dijitTreeLabel" : "dijitTreeLabel Unread";
@@ -275,7 +288,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"],
treeNode = treeNode[0];
const icon = dojo.doc.createElement('img');
icon.src = src;
icon.className = 'tinyFeedIcon';
icon.className = 'icon';
domConstruct.place(icon, treeNode.iconNode, 'only');
return true;
}

View File

@@ -11,7 +11,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
} else {
icon.src = 'images/blank_icon.gif';
}
icon.className = 'tinyFeedIcon';
icon.className = 'icon';
domConstruct.place(icon, tnode.iconNode, 'only');
let param = this.model.store.getValue(args.item, 'param');
@@ -80,7 +80,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
"dijitTreeRow Error";
},
getIconClass: function (item, opened) {
return (!item || this.model.store.getValue(item, 'type') == 'category') ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "feedIcon";
return (!item || this.model.store.getValue(item, 'type') == 'category') ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "feed-icon";
},
reload: function() {
const searchElem = $("feed_search");