mirror of https://github.com/layui/layui
优化 dropdown 的 `click` 回调函数,当其返回 `return false` 时,点击菜单可不关闭面板
parent
78609d9745
commit
3627677d7f
|
@ -275,8 +275,8 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){
|
|||
var isClickAllScope = options.clickScope === 'all'; // 是否所有父子菜单均触发点击事件
|
||||
|
||||
if((!isChild || isClickAllScope) && data.type !== '-'){
|
||||
isChild || that.remove();
|
||||
typeof options.click === 'function' && options.click(data, othis);
|
||||
var ret = typeof options.click === 'function' && options.click(data, othis);
|
||||
ret === false || (isChild || that.remove());
|
||||
layui.stope(e);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue