Merge pull request #422 from xwiki-labs/contextmenuIconsEverywhere

Contextmenu icons everywhere
pull/1/head
ansuz 5 years ago committed by GitHub
commit da3763a14b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2863,9 +2863,21 @@ define([
}, [
h('li', h('a.dropdown-item', {
'tabindex': '-1',
'data-icon': "fa-cloud-upload",
}, Messages.pad_mediatagImport))
])
]);
// create the icon for each contextmenu option
$(menu).find("li a.dropdown-item").each(function (i, el) {
var $icon = $("<span>");
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;

Loading…
Cancel
Save