1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 17:05:56 +00:00

move to let/const syntax in custom dojo modules

This commit is contained in:
Andrew Dolgov
2018-11-29 21:21:06 +03:00
parent 9dc5524df1
commit 0267212454
6 changed files with 108 additions and 108 deletions

View 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);