]> git.wh0rd.org - tt-rss.git/blobdiff - js/PrefFeedTree.js
move to let/const syntax in custom dojo modules
[tt-rss.git] / js / PrefFeedTree.js
index b3ea0c4259be86781d759685cdfea26aac026a69..9d6a9e86c9e18c4875bf22f3e923a05c64f491be 100644 (file)
@@ -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);