summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-02-22 16:44:31 +0300
committerAndrew Dolgov <[email protected]>2020-02-22 16:44:31 +0300
commit788ea95fbda1939d49472bdf76ccea5f0d193c07 (patch)
tree7e428b19f409ab1131a806f68e21fc426855449f /js
parent4ab3854aede3882779138d91594b588e1a38c70e (diff)
feed tree: do not mark Labels as Special
Diffstat (limited to 'js')
-rw-r--r--js/AppBase.js2
-rwxr-xr-xjs/FeedTree.js5
-rwxr-xr-xjs/common.js8
3 files changed, 8 insertions, 7 deletions
diff --git a/js/AppBase.js b/js/AppBase.js
index b6d4082df..86cc44e8a 100644
--- a/js/AppBase.js
+++ b/js/AppBase.js
@@ -367,7 +367,7 @@ define(["dojo/_base/declare"], function (declare) {
if (params.hasOwnProperty(k)) {
switch (k) {
case "label_base_index":
- _label_base_index = parseInt(params[k]);
+ LABEL_BASE_INDEX = parseInt(params[k]);
break;
case "cdm_auto_catchup":
if (params[k] == 1) {
diff --git a/js/FeedTree.js b/js/FeedTree.js
index a1a48d586..85892b3d9 100755
--- a/js/FeedTree.js
+++ b/js/FeedTree.js
@@ -33,7 +33,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"],
const id = args.item.id[0];
const bare_id = parseInt(id.substr(id.indexOf(':')+1));
- if (bare_id < _label_base_index) {
+ if (bare_id < LABEL_BASE_INDEX) {
const label = dojo.create('i', { className: "material-icons icon icon-label", innerHTML: "label" });
//const fg_color = args.item.fg_color[0];
@@ -163,8 +163,9 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"],
if (item.auxcounter > 0) rc += " Has_Aux";
if (item.markedcounter > 0) rc += " Has_Marked";
if (item.updates_disabled > 0) rc += " UpdatesDisabled";
- if (item.bare_id < 0 && !is_cat || item.bare_id == 0 && !is_cat) rc += " Special";
+ if (item.bare_id >= LABEL_BASE_INDEX && item.bare_id < 0 && !is_cat || item.bare_id == 0 && !is_cat) rc += " Special";
if (item.bare_id == -1 && is_cat) rc += " AlwaysVisible";
+ if (item.bare_id < LABEL_BASE_INDEX) rc += " Label";
return rc;
},
diff --git a/js/common.js b/js/common.js
index e93087eb4..69b528a1c 100755
--- a/js/common.js
+++ b/js/common.js
@@ -1,7 +1,7 @@
'use strict'
/* global dijit, __ */
-let _label_base_index = -1024;
+let LABEL_BASE_INDEX = -1024; /* not const because it's assigned at least once (by backend) */
let loading_progress = 0;
/* error reporting shim */
@@ -252,12 +252,12 @@ function displayIfChecked(checkbox, elemId) {
// noinspection JSUnusedGlobalSymbols
function label_to_feed_id(label) {
- return _label_base_index - 1 - Math.abs(label);
+ return LABEL_BASE_INDEX - 1 - Math.abs(label);
}
// noinspection JSUnusedGlobalSymbols
function feed_to_label_id(feed) {
- return _label_base_index - 1 + Math.abs(feed);
+ return LABEL_BASE_INDEX - 1 + Math.abs(feed);
}
// http://stackoverflow.com/questions/6251937/how-to-get-selecteduser-highlighted-text-in-contenteditable-element-and-replac
@@ -313,4 +313,4 @@ function escapeHtml(text) {
};
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
-} \ No newline at end of file
+}