mirror of https://github.com/layui/layui
修复 dropdown 菜单(group)展开折叠时重置标题中所有图标的问题
修复 dropdown 菜单(group)展开折叠时重置标题中所有图标的问题pull/1307/head
commit
532251dda4
|
@ -419,13 +419,14 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){
|
|||
//设置菜单组展开和收缩状态
|
||||
thisModule.spread = function(othis){
|
||||
//菜单组展开和收缩
|
||||
var elemIcon = othis.children('.'+ STR_MENU_TITLE).find('.layui-icon');
|
||||
if(othis.hasClass(STR_ITEM_UP)){
|
||||
var needSpread = othis.hasClass(STR_ITEM_UP);
|
||||
var elemIcon = othis.children('.'+ STR_MENU_TITLE).find('.layui-icon-' + (needSpread ? 'down' : 'up'));
|
||||
if(needSpread){
|
||||
othis.removeClass(STR_ITEM_UP).addClass(STR_ITEM_DOWN);
|
||||
elemIcon.removeClass('layui-icon-down').addClass('layui-icon-up');
|
||||
} else {
|
||||
othis.removeClass(STR_ITEM_DOWN).addClass(STR_ITEM_UP);
|
||||
elemIcon.removeClass('layui-icon-up').addClass('layui-icon-down')
|
||||
elemIcon.removeClass('layui-icon-up').addClass('layui-icon-down');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue