From 00caf68082b8f029d73d5ca93cc0715176ef0bb2 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 20 Nov 2019 12:05:59 +0300 Subject: [PATCH] [component] hide 'check' marker for custom style of 'checked' state --- apps/common/main/lib/component/MenuItem.js | 1 + apps/common/main/resources/less/dropdown-menu.less | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/component/MenuItem.js b/apps/common/main/lib/component/MenuItem.js index c54501185..6d710cbec 100644 --- a/apps/common/main/lib/component/MenuItem.js +++ b/apps/common/main/lib/component/MenuItem.js @@ -183,6 +183,7 @@ define([ if (this.checkable && firstChild) { firstChild.toggleClass('checkable', this.checkable); + firstChild.toggleClass('no-checkmark', this.options.checkmark===false); firstChild.toggleClass('checked', this.checked); if (!_.isEmpty(this.iconCls)) { firstChild.css('background-image', 'none'); diff --git a/apps/common/main/resources/less/dropdown-menu.less b/apps/common/main/resources/less/dropdown-menu.less index 0c6a49ffb..3c645efd1 100644 --- a/apps/common/main/resources/less/dropdown-menu.less +++ b/apps/common/main/resources/less/dropdown-menu.less @@ -47,7 +47,7 @@ background-color: @dropdown-link-hover-bg; } - .checked { + .checked:not(.no-checkmark) { &:before { content: ''; width: 16px; @@ -71,11 +71,18 @@ .menu-item-icon { display: inline-block; float: left; - width: 22px; - height: 22px; + width: 20px; + height: 20px; margin: -3px 5px 0 -15px; .background-ximage-v2('popupmenu-btns.png', 66px, @commonimage: false); background-repeat: no-repeat; } + + .no-checkmark.checked { + .menu-item-icon { + background-color: @primary; + border-radius: 2px; + } + } } } \ No newline at end of file