Skip to content

Commit

Permalink
Merge pull request #2487 from Novik/webui-fix
Browse files Browse the repository at this point in the history
Merge pull request #2397 from TrimmingFool/add-tacklabels-icon-upload
  • Loading branch information
stickz committed Apr 18, 2023
2 parents a3dc4fb + 1f46630 commit 851b3e9
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions plugins/tracklabels/init.js
Expand Up @@ -77,12 +77,25 @@ if(!$type(theWebUI.getTrackerName))

plugin.contextMenuEntries = theWebUI.contextMenuEntries;
theWebUI.contextMenuEntries = function(labelType, el) {
if (labelType === 'ptrackers_cont') {
return plugin.canChangeMenu() ? [] : false;
const entries = plugin.contextMenuEntries.call(theWebUI, labelType, el);
if (plugin.canChangeMenu() && ['ptrackers_cont', 'plabel_cont'].includes(labelType)) {
const lbl = 'ptrackers_cont' === labelType ? el.id.substr(1) : theWebUI.idToLbl(el.id);
if (lbl)
return entries.concat([
[theUILang.EditIcon, `theWebUI.showTracklabelsDialog('${lbl}');`]
]);
}
return plugin.contextMenuEntries.call(theWebUI, labelType, el);
return entries;
}


theWebUI.showTracklabelsDialog = function(lbl) {
$(`#${plugin.dialogId} input[type=text]`).val(lbl);
theDialogManager.show(plugin.dialogId);
}



plugin.updateLabel = theWebUI.updateLabel;
theWebUI.updateLabel = function(label, ...args)
{
Expand Down

0 comments on commit 851b3e9

Please sign in to comment.