From b5a58b9604b801a6812c39d67cbae6ca0b79e500 Mon Sep 17 00:00:00 2001 From: ClemDee Date: Fri, 2 Aug 2019 15:50:11 +0200 Subject: [PATCH 1/3] Add contextmenu icons for code and slide app --- www/common/common-ui-elements.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 207d00336..b228ecc7e 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2856,9 +2856,20 @@ define([ }, [ h('li', h('a.dropdown-item', { 'tabindex': '-1', + 'data-icon': "cptools-file", }, Messages.pad_mediatagImport)) ]) ]); + $(menu).find("li a.dropdown-item").each(function (i, el) { + var $icon = $(""); + if ($(el).attr('data-icon')) { + var font = $(el).attr('data-icon').indexOf('cptools') === 0 ? 'cptools' : 'fa'; + $icon.addClass(font).addClass($(el).attr('data-icon')); + } else { + $icon.text($(el).text()); + } + $(el).prepend($icon); + }); var m = createContextMenu(menu); mediatagContextMenu = m; From 73051ad30f3a4759c957d45fc98822ff291fe8de Mon Sep 17 00:00:00 2001 From: ClemDee Date: Fri, 9 Aug 2019 13:28:09 +0200 Subject: [PATCH 2/3] Change save-in-your-cryptdrive icon on code contextmenu --- www/common/common-ui-elements.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index b228ecc7e..f4551c4ef 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2856,7 +2856,7 @@ define([ }, [ h('li', h('a.dropdown-item', { 'tabindex': '-1', - 'data-icon': "cptools-file", + 'data-icon': "fa-cloud-upload", }, Messages.pad_mediatagImport)) ]) ]); From e29e105bb04e0e77df0bce3a54e17208c4391b42 Mon Sep 17 00:00:00 2001 From: ClemDee Date: Mon, 12 Aug 2019 10:50:12 +0200 Subject: [PATCH 3/3] Add comment to get the code more friendly --- www/common/common-ui-elements.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index f4551c4ef..f338be075 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2860,6 +2860,7 @@ define([ }, Messages.pad_mediatagImport)) ]) ]); + // create the icon for each contextmenu option $(menu).find("li a.dropdown-item").each(function (i, el) { var $icon = $(""); if ($(el).attr('data-icon')) {