mirror of https://github.com/layui/layui
				
				
				
			优化 `checkbox` 半选状态样式
							parent
							
								
									0ca0fddca3
								
							
						
					
					
						commit
						ee6038b82d
					
				| 
						 | 
				
			
			@ -838,8 +838,8 @@ a cite{font-style: normal; *cursor:pointer;}
 | 
			
		|||
.layui-form-checked.layui-checkbox-disabled[lay-skin="primary"] i{background: #eee!important; border-color: #eee!important;}
 | 
			
		||||
.layui-checkbox-disabled[lay-skin="primary"]:hover i{border-color: #d2d2d2;}
 | 
			
		||||
.layui-form-item .layui-form-checkbox[lay-skin="primary"]{margin-top: 10px;}
 | 
			
		||||
.layui-form-checkbox[lay-skin="primary"] > i.layui-icon-subtraction,
 | 
			
		||||
.layui-form-checkbox[lay-skin="primary"]:hover i.layui-icon-subtraction {color: darkgray;}
 | 
			
		||||
.layui-form-checkbox[lay-skin="primary"] .layui-icon-indeterminate:before{content: ''; display: inline-block; vertical-align: middle; position: relative; width: 50%; height: 1px; margin: -1px auto 0; background-color: #d2d2d2;}
 | 
			
		||||
.layui-form-checkbox[lay-skin="primary"]:hover .layui-icon-indeterminate:before{background-color: #16b777;}
 | 
			
		||||
 | 
			
		||||
/* 复选框-开关风格 */.layui-form-switch{position: relative; display: inline-block; vertical-align: middle; height: 22px; line-height: 22px; min-width: 35px; padding: 0 5px; margin-top: 8px; border: 1px solid #d2d2d2; border-radius: 20px; cursor: pointer; background-color: #fff; -webkit-transition: .1s linear; transition: .1s linear;}
 | 
			
		||||
.layui-form-switch i{position: absolute; left: 5px; top: 3px; width: 16px; height: 16px; border-radius: 20px; background-color: #d2d2d2; -webkit-transition: .1s linear; transition: .1s linear;}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -624,7 +624,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){
 | 
			
		|||
        var CLASS = {
 | 
			
		||||
          "checkbox": ['layui-form-checkbox', 'layui-form-checked', 'checkbox'],
 | 
			
		||||
          "switch": ['layui-form-switch', 'layui-form-onswitch', 'switch'],
 | 
			
		||||
          SUBTRA: 'layui-icon-subtraction'
 | 
			
		||||
          SUBTRA: 'layui-icon-indeterminate'
 | 
			
		||||
        };
 | 
			
		||||
        var checks = elem || elemForm.find('input[type=checkbox]');
 | 
			
		||||
        // 风格
 | 
			
		||||
| 
						 | 
				
			
			@ -643,6 +643,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){
 | 
			
		|||
            var title = (check.attr('title')||'').split('|');
 | 
			
		||||
 | 
			
		||||
            if(check[0].disabled) return;
 | 
			
		||||
            
 | 
			
		||||
            if (check[0].indeterminate) {
 | 
			
		||||
              check[0].indeterminate = false;
 | 
			
		||||
              reElem.find(CLASS.SUBTRA).removeClass(CLASS.SUBTRA).addClass('layui-icon-ok')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue