summaryrefslogtreecommitdiff
path: root/js/PrefFeedTree.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-11-29 21:21:06 +0300
committerAndrew Dolgov <[email protected]>2018-11-29 21:21:06 +0300
commit02672124540518006cf159446a9f62a9f5b94aa5 (patch)
treed4c77a997632ab2923e88147bdbf0d56ad7514b6 /js/PrefFeedTree.js
parent9dc5524df1a91252eee3247d2b8b2549df79150f (diff)
move to let/const syntax in custom dojo modules
Diffstat (limited to 'js/PrefFeedTree.js')
-rw-r--r--js/PrefFeedTree.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js
index b3ea0c425..9d6a9e86c 100644
--- a/js/PrefFeedTree.js
+++ b/js/PrefFeedTree.js
@@ -1,10 +1,11 @@
+/* global lib,dijit */
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], function (declare, domConstruct) {
return declare("fox.PrefFeedTree", lib.CheckBoxTree, {
_createTreeNode: function(args) {
- var tnode = this.inherited(arguments);
+ const tnode = this.inherited(arguments);
- var icon = dojo.doc.createElement('img');
+ const icon = dojo.doc.createElement('img');
if (args.item.icon && args.item.icon[0]) {
icon.src = args.item.icon[0];
} else {
@@ -13,7 +14,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
icon.className = 'tinyFeedIcon';
domConstruct.place(icon, tnode.iconNode, 'only');
- var param = this.model.store.getValue(args.item, 'param');
+ let param = this.model.store.getValue(args.item, 'param');
if (param) {
param = dojo.doc.createElement('span');
@@ -23,8 +24,8 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
domConstruct.place(param, tnode.rowNode, 'first');
}
- var id = args.item.id[0];
- var bare_id = parseInt(id.substr(id.indexOf(':')+1));
+ const id = args.item.id[0];
+ const bare_id = parseInt(id.substr(id.indexOf(':')+1));
if (id.match("CAT:") && bare_id > 0) {
var menu = new dijit.Menu();
@@ -82,12 +83,12 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
return (!item || this.model.store.getValue(item, 'type') == 'category') ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "feedIcon";
},
checkItemAcceptance: function(target, source, position) {
- var item = dijit.getEnclosingWidget(target).item;
+ const item = dijit.getEnclosingWidget(target).item;
// disable copying items
source.copyState = function() { return false; };
- var source_item = false;
+ let source_item = false;
source.forInSelectedItems(function(node) {
source_item = node.data.item;
@@ -95,8 +96,8 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
if (!source_item || !item) return false;
- var id = this.tree.model.store.getValue(item, 'id');
- var source_id = source.tree.model.store.getValue(source_item, 'id');
+ const id = this.tree.model.store.getValue(item, 'id');
+ const source_id = source.tree.model.store.getValue(source_item, 'id');
//console.log(id + " " + position + " " + source_id);