Add icons in context menu

This commit is contained in:
ClemDee 2019-06-25 10:43:40 +02:00
parent ba95ad6bf5
commit 29a2e3a0ea
3 changed files with 16 additions and 0 deletions

View file

@ -26,6 +26,8 @@
@colortheme_form-warning: #f49842;
@colortheme_form-warning-hov: darken(@colortheme_form-warning, 5%);
@colortheme_context-menu-icon-color: #7b7b7b;
@colortheme_modal-bg: @colortheme_form-bg-alt; // TODO Modals bg
@colortheme_modal-fg: @colortheme_form-color-alt;
@colortheme_modal-link: @colortheme_link-color;

View file

@ -13,6 +13,10 @@
font-size: @colortheme_app-font-size;
a {
cursor: pointer;
.fa, .cptools {
margin-right: 1rem;
color: @colortheme_context-menu-icon-color;
}
}
}
.cp-app-drive-context-noAction {

View file

@ -413,6 +413,16 @@ define([
}, Messages.fc_prop)),
])
]);
$(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);
});
return $(menu);
};