diff --git a/docs/form/checkbox.md b/docs/form/checkbox.md index 7946487c..774add63 100644 --- a/docs/form/checkbox.md +++ b/docs/form/checkbox.md @@ -18,7 +18,20 @@ toc: true + + + + @@ -41,7 +54,7 @@ toc: true
{{- d.include("/layer/examples/alert.md") }} diff --git a/docs/layer/detail/options.md b/docs/layer/detail/options.md index 4c65de25..415169b8 100644 --- a/docs/layer/detail/options.md +++ b/docs/layer/detail/options.md @@ -20,11 +20,11 @@ 弹层类型。 可选值有: -- `0` dialog 信息框 -- `1` page 页面层 -- `2` iframe 内联框架层 -- `3` loading 加载层 -- `4` tips 贴士层 +- `0` dialog 信息框(默认),*同时只能存在一个层* +- `1` page 页面层,*可同时存在多个层* +- `2` iframe 内联框架层,*可同时存在多个层* +- `3` loading 加载层,*同时只能存在一个层* +- `4` tips 贴士层,*可配置同时存在多个层* `layer` 弹层由以上 5 种类型构成。 不同的类型代表不同的弹出形态,`layer` 提供的所有的弹出方式均由此衍生。 diff --git a/src/css/layui.css b/src/css/layui.css index c14ae851..cf131409 100644 --- a/src/css/layui.css +++ b/src/css/layui.css @@ -821,7 +821,7 @@ a cite{font-style: normal; *cursor:pointer;} .layui-form-checkbox{position: relative; display: inline-block; vertical-align: middle; height: 30px; line-height: 30px; margin-right: 10px; padding-right: 30px; background-color: #fff; cursor: pointer; font-size: 0; -webkit-transition: .1s linear; transition: .1s linear; box-sizing: border-box;} .layui-form-checkbox:hover{} .layui-form-checkbox > *{display: inline-block; vertical-align: middle;} -.layui-form-checkbox > div{padding: 0 11px; height: 100%; font-size: 14px; border-radius: 2px 0 0 2px; background-color: #d2d2d2; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;} +.layui-form-checkbox > div{padding: 0 11px; font-size: 14px; border-radius: 2px 0 0 2px; background-color: #d2d2d2; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;} .layui-form-checkbox:hover > div{background-color: #c2c2c2;} .layui-form-checkbox > i{position: absolute; right: 0; top: 0; width: 30px; height: 100%; border: 1px solid #d2d2d2; border-left: none; border-radius: 0 2px 2px 0; color: #fff; color: rgba(255,255,255,0); font-size: 20px; text-align: center; box-sizing: border-box;} .layui-form-checkbox:hover > i{border-color: #c2c2c2; color: #c2c2c2;} @@ -838,7 +838,7 @@ a cite{font-style: normal; *cursor:pointer;} /* 复选框-默认风格 */ .layui-form-checkbox[lay-skin="primary"]{height: auto!important; line-height: normal!important; min-width: 18px; min-height: 18px; border: none!important; margin-right: 0; padding-left: 24px; padding-right: 0; background: none;} .layui-form-checkbox[lay-skin="primary"] > div{margin-top: -1px; padding-left: 0; padding-right: 15px; line-height: 18px; background: none; color: #5F5F5F;} -.layui-form-checkbox[lay-skin="primary"] > i{right: auto; left: 0; width: 18px; height: 18px; line-height: 16px; border: 1px solid #d2d2d2; font-size: 12px; border-radius: 2px; background-color: #fff; -webkit-transition: .1s linear; transition: .1s linear;} +.layui-form-checkbox[lay-skin="primary"] > i{right: auto; left: 0; width: 16px; height: 16px; line-height: 14px; border: 1px solid #d2d2d2; font-size: 12px; border-radius: 2px; background-color: #fff; -webkit-transition: .1s linear; transition: .1s linear;} .layui-form-checkbox[lay-skin="primary"]:hover > i{border-color: #16b777; color: #fff;} .layui-form-checked[lay-skin="primary"] > i{border-color: #16b777 !important; background-color: #16b777; color: #fff;} .layui-checkbox-disabled[lay-skin="primary"] > div{background: none!important;} @@ -1014,7 +1014,7 @@ a cite{font-style: normal; *cursor:pointer;} .layui-table-view .layui-table td[data-edit]{cursor: text;} .layui-table-view .layui-table td[data-edit]:hover:after{position: absolute; left: 0; top: 0; width: 100%; height: 100%; box-sizing: border-box; border: 1px solid #16B777; pointer-events: none; content: "";} -.layui-table-view .layui-form-checkbox[lay-skin="primary"] i{width: 18px; height: 18px;} +.layui-table-view .layui-form-checkbox[lay-skin="primary"] i{width: 18px; height: 18px; line-height: 16px;} .layui-table-view .layui-form-radio{line-height: 0; padding: 0;} .layui-table-view .layui-form-radio>i{margin: 0; font-size: 20px;} .layui-table-init{position: absolute; left: 0; top: 0; width: 100%; height: 100%; text-align: center; z-index: 199;} diff --git a/src/css/modules/layer.css b/src/css/modules/layer.css index f043c6ee..5b45dd7a 100644 --- a/src/css/modules/layer.css +++ b/src/css/modules/layer.css @@ -191,7 +191,7 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;} /* 内置 skin */ .layui-layer-lan .layui-layer-title{background:#4476A7; color:#fff; border: none;} -.layui-layer-lan .layui-layer-btn{padding: 5px 10px 10px; text-align: right; border-top:1px solid #E9E7E7} +.layui-layer-lan .layui-layer-btn{padding: 5px 10px 10px; border-top:1px solid #E9E7E7} .layui-layer-lan .layui-layer-btn a{background: #fff; border-color: #E9E7E7; color: #333;} .layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5;} .layui-layer-molv .layui-layer-title{background: #009f95; color:#fff; border: none;} diff --git a/src/modules/code.js b/src/modules/code.js index 3db86394..aa6c4ba6 100644 --- a/src/modules/code.js +++ b/src/modules/code.js @@ -186,8 +186,15 @@ layui.define(['lay', 'util', 'element', 'form'], function(exports){ }); // copy - if(options.copy && layui.type(options.tools) === 'array'){ - options.tools.unshift('copy'); + if(options.copy){ + if(layui.type(options.tools) === 'array'){ + // 若 copy 未存在于 tools 中,则追加到最前 + if(options.tools.indexOf('copy') === -1){ + options.tools.unshift('copy'); + } + } else { + options.tools = ['copy']; + } } // 工具栏事件 @@ -217,7 +224,7 @@ layui.define(['lay', 'util', 'element', 'form'], function(exports){ // 追加预览 if(isIframePreview){ - elemPreviewView.html(''); + elemPreviewView.html(''); } // 执行预览 diff --git a/src/modules/form.js b/src/modules/form.js index d11ee935..4cda8b4f 100644 --- a/src/modules/form.js +++ b/src/modules/form.js @@ -690,12 +690,12 @@ layui.define(['lay', 'layer', 'util'], function(exports){ }())); var disabled = this.disabled; - if(!skins[skin]) skin = 'primary'; // 若非内置风格,则强制为默认风格 + // if(!skins[skin]) skin = 'primary'; // 若非内置风格,则强制为默认风格 var RE_CLASS = CLASS[skin] || CLASS.checkbox; // 替代元素 var hasRender = othis.next('.' + RE_CLASS[0]); - hasRender[0] && hasRender.remove(); // 如果已经渲染,则Rerender + hasRender[0] && hasRender.remove(); // 若已经渲染,则 Rerender // 若存在标题模板,则优先读取标题模板 if(othis.next('[lay-checkbox]')[0]){