Skip to content

Commit

Permalink
Merge pull request #2554 from TrimmingFool/v4.2
Browse files Browse the repository at this point in the history
context-menu: Fix label selection
  • Loading branch information
stickz authored Aug 20, 2023
2 parents 15be3ec + b1290fb commit fcea54c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1481,12 +1481,13 @@ var theWebUI =
_bf.push([theUILang.New_label, (table.selCount > 1) || this.isTorrentCommandEnabled("setlabel",id) ? "theWebUI.newLabel()" : null]);
_bf.push([theUILang.Remove_label, (table.selCount > 1) || this.isTorrentCommandEnabled("setlabel",id) ? "theWebUI.removeLabel()" : null]);
_bf.push([CMENU_SEP]);
for(var lbl in this.cLabels)
for(var labelId in this.cLabels)
{
const lbl = labelId.substring(8);
var lblText = this.settings['webui.show_label_path_tree'] ?
'│'.repeat(this.cLabels[lbl].level) + this.cLabelText(lbl):
'│'.repeat(this.cLabels[labelId].level) + this.cLabelText(labelId):
lbl;
if((table.selCount == 1) && (this.torrents[id].label == lbl))
if((table.selCount == 1) && (this.torrents[id].label === lbl))
_bf.push([CMENU_SEL, lblText]);
else
_bf.push([lblText, (table.selCount > 1) || this.isTorrentCommandEnabled("setlabel",id) ? "theWebUI.setLabel('" + addslashes(lbl) + "')" : null]);
Expand Down

0 comments on commit fcea54c

Please sign in to comment.