Add icons in context menu

pull/1/head
ClemDee 6 years ago
parent ba95ad6bf5
commit 29a2e3a0ea

@ -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;

@ -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 {

@ -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);
};

Loading…
Cancel
Save