From 02672124540518006cf159446a9f62a9f5b94aa5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 29 Nov 2018 21:21:06 +0300 Subject: move to let/const syntax in custom dojo modules --- js/PrefFeedTree.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'js/PrefFeedTree.js') 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); -- cgit v1.2.3