summaryrefslogtreecommitdiff
path: root/js/FeedStoreModel.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/FeedStoreModel.js
parent9dc5524df1a91252eee3247d2b8b2549df79150f (diff)
move to let/const syntax in custom dojo modules
Diffstat (limited to 'js/FeedStoreModel.js')
-rw-r--r--js/FeedStoreModel.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/js/FeedStoreModel.js b/js/FeedStoreModel.js
index 49641a732..7f2af22ec 100644
--- a/js/FeedStoreModel.js
+++ b/js/FeedStoreModel.js
@@ -4,7 +4,7 @@ define(["dojo/_base/declare", "dijit/tree/ForestStoreModel"], function (declare)
getItemsInCategory: function (id) {
if (!this.store._itemsByIdentity) return undefined;
- cat = this.store._itemsByIdentity['CAT:' + id];
+ let cat = this.store._itemsByIdentity['CAT:' + id];
if (cat && cat.items)
return cat.items;
@@ -30,7 +30,7 @@ define(["dojo/_base/declare", "dijit/tree/ForestStoreModel"], function (declare)
return this.getFeedValue(feed, is_cat, 'name');
},
getFeedUnread: function (feed, is_cat) {
- var unread = parseInt(this.getFeedValue(feed, is_cat, 'unread'));
+ const unread = parseInt(this.getFeedValue(feed, is_cat, 'unread'));
return (isNaN(unread)) ? 0 : unread;
},
setFeedUnread: function (feed, is_cat, unread) {
@@ -58,14 +58,14 @@ define(["dojo/_base/declare", "dijit/tree/ForestStoreModel"], function (declare)
treeItem = this.store._itemsByIdentity['FEED:' + feed];
}
- items = this.store._arrayOfAllItems;
+ let items = this.store._arrayOfAllItems;
- for (var i = 0; i < items.length; i++) {
+ for (let i = 0; i < items.length; i++) {
if (items[i] == treeItem) {
for (var j = i + 1; j < items.length; j++) {
- var unread = this.store.getValue(items[j], 'unread');
- var id = this.store.getValue(items[j], 'id');
+ let unread = this.store.getValue(items[j], 'unread');
+ let id = this.store.getValue(items[j], 'id');
if (unread > 0 && ((is_cat && id.match("CAT:")) || (!is_cat && id.match("FEED:")))) {
if (!is_cat || !(this.store.hasAttribute(items[j], 'parent_id') && this.store.getValue(items[j], 'parent_id') == feed)) return items[j];
@@ -73,8 +73,8 @@ define(["dojo/_base/declare", "dijit/tree/ForestStoreModel"], function (declare)
}
for (var j = 0; j < i; j++) {
- var unread = this.store.getValue(items[j], 'unread');
- var id = this.store.getValue(items[j], 'id');
+ let unread = this.store.getValue(items[j], 'unread');
+ let id = this.store.getValue(items[j], 'id');
if (unread > 0 && ((is_cat && id.match("CAT:")) || (!is_cat && id.match("FEED:")))) {
if (!is_cat || !(this.store.hasAttribute(items[j], 'parent_id') && this.store.getValue(items[j], 'parent_id') == feed)) return items[j];