mirror of https://github.com/layui/layui
优化 checkbox 半选对应的 className 常量
parent
fed8fd4f3d
commit
4a03a5add1
|
@ -623,7 +623,8 @@ layui.define(['lay', 'layer', 'util'], function(exports){
|
||||||
,checkbox: function(elem){
|
,checkbox: function(elem){
|
||||||
var CLASS = {
|
var CLASS = {
|
||||||
"checkbox": ['layui-form-checkbox', 'layui-form-checked', 'checkbox'],
|
"checkbox": ['layui-form-checkbox', 'layui-form-checked', 'checkbox'],
|
||||||
"switch": ['layui-form-switch', 'layui-form-onswitch', 'switch']
|
"switch": ['layui-form-switch', 'layui-form-onswitch', 'switch'],
|
||||||
|
SUBTRA: 'layui-icon-subtraction'
|
||||||
};
|
};
|
||||||
var checks = elem || elemForm.find('input[type=checkbox]');
|
var checks = elem || elemForm.find('input[type=checkbox]');
|
||||||
// 风格
|
// 风格
|
||||||
|
@ -644,7 +645,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){
|
||||||
if(check[0].disabled) return;
|
if(check[0].disabled) return;
|
||||||
if (check[0].indeterminate) {
|
if (check[0].indeterminate) {
|
||||||
check[0].indeterminate = false;
|
check[0].indeterminate = false;
|
||||||
reElem.find('.layui-icon-subtraction').removeClass('layui-icon-subtraction').addClass('layui-icon-ok')
|
reElem.find(CLASS.SUBTRA).removeClass(CLASS.SUBTRA).addClass('layui-icon-ok')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -691,7 +692,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){
|
||||||
// 复选框
|
// 复选框
|
||||||
"checkbox": [
|
"checkbox": [
|
||||||
(title[0] ? ('<span>'+ util.escape(title[0]) +'</span>') : '')
|
(title[0] ? ('<span>'+ util.escape(title[0]) +'</span>') : '')
|
||||||
,'<i class="layui-icon '+(skin === 'primary' && !check.checked && othis.get(0).indeterminate ? 'layui-icon-subtraction' : 'layui-icon-ok')+'"></i>'
|
,'<i class="layui-icon '+(skin === 'primary' && !check.checked && othis.get(0).indeterminate ? CLASS.SUBTRA : 'layui-icon-ok')+'"></i>'
|
||||||
].join(''),
|
].join(''),
|
||||||
|
|
||||||
// 开关
|
// 开关
|
||||||
|
|
Loading…
Reference in New Issue