update
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
|
||||
@Name: layui
|
||||
@Author: 贤心
|
||||
@Site: www.layui.com
|
||||
@Description: Classic modular front-end UI framework
|
||||
@License: MIT
|
||||
|
||||
*/
|
||||
|
||||
@@ -20,9 +20,9 @@ input,button,textarea,select,optgroup,option{font-family: inherit; font-size: in
|
||||
pre{white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;}
|
||||
|
||||
/** 初始化全局标签 **/
|
||||
body{line-height: 24px; font: 14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;}
|
||||
hr{height: 1px; margin: 10px 0; border: 0; clear: both;}
|
||||
a{color: #333; text-decoration:none; }
|
||||
body{line-height: 1.6; color: #333; color: rgba(0,0,0,.85); font: 14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;}
|
||||
hr{height: 0; line-height: 0; margin: 10px 0; padding: 0; border: none!important; border-bottom: 1px solid #eee !important; clear: both; overflow: hidden; background: none;}
|
||||
a{color: #333; text-decoration:none;}
|
||||
a:hover{color: #777;}
|
||||
a cite{font-style: normal; *cursor:pointer;}
|
||||
|
||||
@@ -43,6 +43,8 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
/* 纯圆角 */.layui-circle{border-radius: 100%;}
|
||||
.layui-show{display: block !important;}
|
||||
.layui-hide{display: none !important;}
|
||||
.layui-show-v{visibility: visible !important;}
|
||||
.layui-hide-v{visibility: hidden !important;}
|
||||
|
||||
/** 图标字体 **/
|
||||
@font-face {
|
||||
@@ -249,7 +251,8 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-side-scroll{position: relative; width: 220px; height: 100%; overflow-x: hidden;}
|
||||
.layui-body{position: absolute; left: 200px; right: 0; top: 0; bottom: 0; z-index: 998; width: auto; overflow: hidden; overflow-y: auto; box-sizing: border-box;}
|
||||
|
||||
/* 后台框架大布局 */.layui-layout-body{overflow: hidden;}
|
||||
/* 后台框架大布局 */
|
||||
.layui-layout-body{overflow: hidden;}
|
||||
.layui-layout-admin .layui-header{background-color: #23262E;}
|
||||
.layui-layout-admin .layui-side{top: 60px; width: 200px; overflow-x: hidden;}
|
||||
.layui-layout-admin .layui-body{position: fixed; top: 60px; bottom: 44px;}
|
||||
@@ -260,11 +263,12 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-layout-left{position: absolute !important; left: 200px; top: 0;}
|
||||
.layui-layout-right{position: absolute !important; right: 0; top: 0;}
|
||||
|
||||
|
||||
/* 栅格布局 */
|
||||
.layui-container{position: relative; margin: 0 auto; padding: 0 15px; box-sizing: border-box;}
|
||||
.layui-fluid{position: relative; margin: 0 auto; padding: 0 15px;}
|
||||
|
||||
.layui-row:before, .layui-row:after{content: ''; display: block; clear: both;}
|
||||
.layui-row:before, .layui-row:after{content: ""; display: block; clear: both;}
|
||||
.layui-col-xs1, .layui-col-xs2, .layui-col-xs3, .layui-col-xs4, .layui-col-xs5, .layui-col-xs6, .layui-col-xs7, .layui-col-xs8, .layui-col-xs9, .layui-col-xs10, .layui-col-xs11, .layui-col-xs12
|
||||
,.layui-col-sm1, .layui-col-sm2, .layui-col-sm3, .layui-col-sm4, .layui-col-sm5, .layui-col-sm6, .layui-col-sm7, .layui-col-sm8, .layui-col-sm9, .layui-col-sm10, .layui-col-sm11, .layui-col-sm12
|
||||
,.layui-col-md1, .layui-col-md2, .layui-col-md3, .layui-col-md4, .layui-col-md5, .layui-col-md6, .layui-col-md7, .layui-col-md8, .layui-col-md9, .layui-col-md10, .layui-col-md11, .layui-col-md12
|
||||
@@ -456,16 +460,16 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
/** 页面元素 **/
|
||||
.layui-btn, .layui-input, .layui-textarea, .layui-upload-button, .layui-select{outline: none; -webkit-appearance: none; transition: all .3s; -webkit-transition: all .3s; box-sizing: border-box;}
|
||||
|
||||
/* 引用 */.layui-elem-quote{margin-bottom: 10px; padding: 15px; line-height: 22px; border-left: 5px solid #009688; border-radius: 0 2px 2px 0; background-color: #f2f2f2;}
|
||||
/* 引用 */.layui-elem-quote{margin-bottom: 10px; padding: 15px; line-height: 1.6; border-left: 5px solid #5FB878; border-radius: 0 2px 2px 0; background-color: #FAFAFA;}
|
||||
.layui-quote-nm{border-style: solid; border-width: 1px; border-left-width: 5px; background: none;}
|
||||
/* 字段集合 */.layui-elem-field{margin-bottom: 10px; padding: 0; border-width: 1px; border-style: solid;}
|
||||
.layui-elem-field legend{margin-left: 20px; padding: 0 10px; font-size: 20px; font-weight: 300;}
|
||||
.layui-field-title{margin: 10px 0 20px; border-width: 0; border-top-width: 1px;}
|
||||
.layui-field-box{padding: 10px 15px;}
|
||||
.layui-field-box{padding: 15px;}
|
||||
.layui-field-title .layui-field-box{padding: 10px 0;}
|
||||
|
||||
/* 进度条 */
|
||||
.layui-progress{position: relative; height: 6px; border-radius: 20px; background-color: #e2e2e2;}
|
||||
.layui-progress{position: relative; height: 6px; border-radius: 20px; background-color: #eee;}
|
||||
.layui-progress-bar{position: absolute; left: 0; top: 0; width: 0; max-width: 100%; height: 6px; border-radius: 20px; text-align: right; background-color: #5FB878; transition: all .3s; -webkit-transition: all .3s;}
|
||||
.layui-progress-big,
|
||||
.layui-progress-big .layui-progress-bar{height: 18px; line-height: 18px;}
|
||||
@@ -485,8 +489,8 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-colla-item,
|
||||
.layui-colla-content{border-top-width: 1px; border-top-style: solid;}
|
||||
.layui-colla-item:first-child{border-top: none;}
|
||||
.layui-colla-title{position: relative; height: 42px; line-height: 42px; padding: 0 15px 0 35px; color: #333; background-color: #f2f2f2; cursor: pointer; font-size: 14px; overflow: hidden;}
|
||||
.layui-colla-content{display: none; padding: 10px 15px; line-height: 22px; color: #666;}
|
||||
.layui-colla-title{position: relative; height: 42px; line-height: 42px; padding: 0 15px 0 35px; color: #333; background-color: #FAFAFA; cursor: pointer; font-size: 14px; overflow: hidden;}
|
||||
.layui-colla-content{display: none; padding: 10px 15px; line-height: 1.6; color: #666;}
|
||||
.layui-colla-icon{position: absolute; left: 15px; top: 0; font-size: 14px;}
|
||||
|
||||
/* 卡片面板 */
|
||||
@@ -500,10 +504,10 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-card .layui-tab{margin: 0;}
|
||||
|
||||
/* 常规面板 */
|
||||
.layui-panel{}
|
||||
.layui-panel{position: relative; border-width: 1px; border-style: solid; border-radius: 2px; box-shadow: 1px 1px 4px rgb(0 0 0 / 8%); background-color: #fff; color: #666;}
|
||||
|
||||
/* 窗口面板 */
|
||||
.layui-panel-window{position: relative; padding: 15px; border-radius: 0; border-top: 5px solid #E6E6E6; background-color: #fff;}
|
||||
.layui-panel-window{position: relative; padding: 15px; border-radius: 0; border-top: 5px solid #eee; background-color: #fff;}
|
||||
|
||||
/* 其它辅助 */
|
||||
.layui-auxiliar-moving{position: fixed; left: 0; right: 0; top: 0; bottom: 0; width: 100%; height: 100%; background: none; z-index: 9999999999;}
|
||||
@@ -523,12 +527,14 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-bg-cyan{background-color: #2F4056!important; color: #fff!important;} /*青*/
|
||||
.layui-bg-blue{background-color: #1E9FFF!important; color: #fff!important;} /*蓝*/
|
||||
.layui-bg-black{background-color: #393D49!important; color: #fff!important;} /*黑*/
|
||||
.layui-bg-gray{background-color: #eee!important; color: #666!important;} /*灰*/
|
||||
.layui-bg-gray{background-color: #FAFAFA!important; color: #666!important;} /*灰*/
|
||||
|
||||
/* 边框 */
|
||||
.layui-border,
|
||||
.layui-quote-nm,
|
||||
.layui-elem-field,
|
||||
.layui-collapse,
|
||||
.layui-panel,
|
||||
.layui-colla-item,
|
||||
.layui-colla-content,
|
||||
.layui-badge-rim,
|
||||
@@ -540,13 +546,21 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-input, .layui-textarea, .layui-select,
|
||||
.layui-form-pane .layui-form-label,
|
||||
.layui-form-pane .layui-form-item[pane],
|
||||
.layui-layedit, .layui-layedit-tool{border-color: #e6e6e6}
|
||||
.layui-layedit, .layui-layedit-tool{border-color: #eee;}
|
||||
|
||||
.layui-border{border-width: 1px; border-style: solid; color: #666!important;}
|
||||
.layui-border-red{border-width: 1px; border-style: solid; border-color: #FF5722!important; color: #FF5722!important;}
|
||||
.layui-border-orange{border-width: 1px; border-style: solid; border-color: #FFB800!important; color: #FFB800!important;}
|
||||
.layui-border-green{border-width: 1px; border-style: solid; border-color: #009688!important; color: #009688!important;}
|
||||
.layui-border-cyan{border-width: 1px; border-style: solid; border-color: #2F4056!important; color: #2F4056!important;}
|
||||
.layui-border-blue{border-width: 1px; border-style: solid; border-color: #1E9FFF!important; color: #1E9FFF!important;}
|
||||
.layui-border-black{border-width: 1px; border-style: solid; border-color: #393D49!important; color: #393D49!important;}
|
||||
|
||||
/* 背景边框 */
|
||||
hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-timeline-item:before{background-color: #eee;}
|
||||
|
||||
/* 文本区域 */
|
||||
.layui-text{line-height: 22px; font-size: 14px; color: #666;}
|
||||
.layui-text{line-height: 1.6; font-size: 14px;}
|
||||
.layui-text h1,
|
||||
.layui-text h2,
|
||||
.layui-text h3{font-weight: 500; color: #333;}
|
||||
@@ -560,6 +574,23 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-text em,
|
||||
.layui-word-aux{color: #999 !important; padding-left: 5px !important; padding-right: 5px !important;}
|
||||
|
||||
/* 字体大小及颜色 */
|
||||
.layui-font-12{font-size: 12px;}
|
||||
.layui-font-14{font-size: 14px;}
|
||||
.layui-font-16{font-size: 16px;}
|
||||
.layui-font-18{font-size: 18px;}
|
||||
.layui-font-20{font-size: 20px;}
|
||||
|
||||
.layui-font-red{color: #FF5722 !important;} /*赤*/
|
||||
.layui-font-orange{color: #FFB800!important;} /*橙*/
|
||||
.layui-font-green{color: #009688!important;} /*绿*/
|
||||
.layui-font-cyan{color: #2F4056!important;} /*青*/
|
||||
.layui-font-blue{color: #01AAED!important;} /*蓝*/
|
||||
.layui-font-black{color: #000!important;} /*黑*/
|
||||
.layui-font-gray{color: #c2c2c2!important;} /*灰*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
按钮
|
||||
@@ -579,27 +610,26 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
|
||||
|
||||
/* 圆角 */.layui-btn-radius{border-radius: 100px;}
|
||||
.layui-btn .layui-icon{margin-right: 3px; font-size: 18px; vertical-align: bottom; vertical-align: middle\0;}
|
||||
.layui-btn .layui-icon{padding: 0 2px; vertical-align: middle\0; vertical-align: bottom;}
|
||||
|
||||
/* 原始 */.layui-btn-primary{border: 1px solid #C9C9C9; background-color: #fff; color: #555;}
|
||||
.layui-btn-primary:hover{border-color: #009688; color: #333}
|
||||
/* 原始 */.layui-btn-primary{border: 1px solid #d2d2d2; background: none; color: #666;}
|
||||
.layui-btn-primary:hover{border-color: #009688; color: #333;}
|
||||
/* 百搭 */.layui-btn-normal{background-color: #1E9FFF;}
|
||||
/* 暖色 */.layui-btn-warm{background-color: #FFB800;}
|
||||
/* 警告 */.layui-btn-danger{background-color: #FF5722;}
|
||||
/* 选中 */.layui-btn-checked{background-color: #5FB878;}
|
||||
/* 禁用 */.layui-btn-disabled,.layui-btn-disabled:hover,.layui-btn-disabled:active{border: 1px solid #e6e6e6; background-color: #FBFBFB; color: #C9C9C9; cursor: not-allowed; opacity: 1;}
|
||||
/* 禁用 */.layui-btn-disabled,.layui-btn-disabled:hover,.layui-btn-disabled:active{border: 1px solid #eee; background-color: #FBFBFB; color: #d2d2d2; cursor: not-allowed; opacity: 1;}
|
||||
|
||||
/* 大型 */.layui-btn-lg{height: 44px; line-height: 44px; padding: 0 25px; font-size: 16px;}
|
||||
/* 小型 */.layui-btn-sm{height: 30px; line-height: 30px; padding: 0 10px; font-size: 12px;}
|
||||
.layui-btn-sm i{font-size: 16px !important;}
|
||||
/* 超小 */.layui-btn-xs{height: 22px; line-height: 22px; padding: 0 5px; font-size: 12px;}
|
||||
.layui-btn-xs i{font-size: 14px !important;}
|
||||
.layui-btn-xs i{font-size: 12px !important;}
|
||||
/* 按钮组 */.layui-btn-group{display: inline-block; vertical-align: middle; font-size: 0;}
|
||||
.layui-btn-group .layui-btn{margin-left: 0!important; margin-right: 0!important; border-left: 1px solid rgba(255,255,255,.5); border-radius: 0;}
|
||||
.layui-btn-group .layui-btn-primary{border-left: none;}
|
||||
.layui-btn-group .layui-btn-primary:hover{border-color: #C9C9C9; color: #009688;}
|
||||
.layui-btn-group .layui-btn-primary:hover{border-color: #d2d2d2; color: #009688;}
|
||||
.layui-btn-group .layui-btn:first-child{border-left: none; border-radius: 2px 0 0 2px;}
|
||||
.layui-btn-group .layui-btn-primary:first-child{border-left: 1px solid #c9c9c9;}
|
||||
.layui-btn-group .layui-btn-primary:first-child{border-left: 1px solid #d2d2d2;}
|
||||
.layui-btn-group .layui-btn:last-child{border-radius: 0 2px 2px 0;}
|
||||
.layui-btn-group .layui-btn+.layui-btn{margin-left: 0;}
|
||||
.layui-btn-group+.layui-btn-group{margin-left: 10px;}
|
||||
@@ -611,8 +641,8 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-textarea::-webkit-input-placeholder,
|
||||
.layui-select::-webkit-input-placeholder{line-height: 1.3;}
|
||||
.layui-input, .layui-textarea{display: block; width: 100%; padding-left: 10px;}
|
||||
.layui-input:hover, .layui-textarea:hover{border-color: #D2D2D2 !important;}
|
||||
.layui-input:focus, .layui-textarea:focus{border-color: #C9C9C9 !important;}
|
||||
.layui-input:hover, .layui-textarea:hover{border-color: #eee !important;}
|
||||
.layui-input:focus, .layui-textarea:focus{border-color: #d2d2d2 !important;}
|
||||
.layui-textarea{position: relative; min-height: 100px; height: auto; line-height: 20px; padding: 6px 10px; resize: vertical;}
|
||||
.layui-select{padding: 0 10px;}
|
||||
.layui-form select,
|
||||
@@ -644,7 +674,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-form-select dl dd{padding: 0 10px; line-height: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
|
||||
.layui-form-select dl dt{font-size: 12px; color: #999;}
|
||||
.layui-form-select dl dd{cursor: pointer;}
|
||||
.layui-form-select dl dd:hover{background-color: #f2f2f2; -webkit-transition: .5s all; transition: .5s all;}
|
||||
.layui-form-select dl dd:hover{background-color: #F6F6F6; -webkit-transition: .5s all; transition: .5s all;}
|
||||
.layui-form-select .layui-select-group dd{padding-left: 20px;}
|
||||
.layui-form-select dl dd.layui-select-tips{padding-left: 10px !important; color: #999;}
|
||||
.layui-form-select dl dd.layui-this{background-color: #5FB878; color: #fff;}
|
||||
@@ -676,7 +706,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-form-checkbox[lay-skin="primary"] i{right: auto; left: 0; width: 16px; height: 16px; 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"]:hover i{border-color: #5FB878; color: #fff;}
|
||||
.layui-form-checked[lay-skin="primary"] i{border-color: #5FB878 !important; background-color: #5FB878; color: #fff;}
|
||||
.layui-checkbox-disbaled[lay-skin="primary"] span{background: none!important; color: #c2c2c2;}
|
||||
.layui-checkbox-disbaled[lay-skin="primary"] span{background: none!important; color: #c2c2c2!important;}
|
||||
.layui-checkbox-disbaled[lay-skin="primary"]:hover i{border-color: #d2d2d2;}
|
||||
.layui-form-item .layui-form-checkbox[lay-skin="primary"]{margin-top: 10px;}
|
||||
|
||||
@@ -687,9 +717,10 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-form-onswitch i{left: 100%; margin-left: -21px; background-color: #fff;}
|
||||
.layui-form-onswitch em{margin-left: 5px; margin-right: 21px; color: #fff!important;}
|
||||
|
||||
.layui-checkbox-disbaled{border-color: #e2e2e2 !important;}
|
||||
.layui-checkbox-disbaled span{background-color: #e2e2e2 !important;}
|
||||
.layui-checkbox-disbaled i{border-color: #e2e2e2 !important;}
|
||||
.layui-checkbox-disbaled{border-color: #eee !important;}
|
||||
.layui-checkbox-disbaled span{background-color: #eee !important;}
|
||||
.layui-checkbox-disbaled i{border-color: #eee !important;}
|
||||
.layui-checkbox-disbaled em{color: #d2d2d2 !important;}
|
||||
.layui-checkbox-disbaled:hover i{color: #fff !important;}
|
||||
|
||||
/* 单选框 */
|
||||
@@ -697,8 +728,11 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-form-radio{display: inline-block; vertical-align: middle; line-height: 28px; margin: 6px 10px 0 0; padding-right: 10px; cursor: pointer; font-size: 0;}
|
||||
.layui-form-radio *{display: inline-block; vertical-align: middle; font-size: 14px;}
|
||||
.layui-form-radio>i{margin-right: 8px; font-size: 22px; color: #c2c2c2;}
|
||||
.layui-form-radioed>i,.layui-form-radio>i:hover{color: #5FB878;}
|
||||
.layui-radio-disbaled>i{color: #e2e2e2 !important;}
|
||||
.layui-form-radioed,
|
||||
.layui-form-radioed>i,
|
||||
.layui-form-radio:hover *{color: #5FB878;}
|
||||
.layui-radio-disbaled>i{color: #eee !important;}
|
||||
.layui-radio-disbaled *{color: #c2c2c2!important;}
|
||||
|
||||
/* 表单方框风格 */.layui-form-pane .layui-form-label{width: 110px; padding: 8px 15px; height: 38px; line-height: 20px; border-width: 1px; border-style: solid; border-radius: 2px 0 0 2px; text-align: center; background-color: #FBFBFB; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-sizing: border-box;}
|
||||
.layui-form-pane .layui-input-inline{margin-left: -1px;}
|
||||
@@ -728,13 +762,13 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
/** 富文本编辑器 **/
|
||||
.layui-layedit{border-width: 1px; border-style: solid; border-radius: 2px;}
|
||||
.layui-layedit-tool{padding: 3px 5px; border-bottom-width: 1px; border-bottom-style: solid; font-size: 0;}
|
||||
.layedit-tool-fixed{position: fixed; top: 0; border-top: 1px solid #e2e2e2;}
|
||||
.layedit-tool-fixed{position: fixed; top: 0; border-top: 1px solid #eee;}
|
||||
.layui-layedit-tool .layedit-tool-mid,
|
||||
.layui-layedit-tool .layui-icon{display: inline-block; vertical-align: middle; text-align: center; font-size: 14px;}
|
||||
.layui-layedit-tool .layui-icon{position: relative; width: 32px; height: 30px; line-height: 30px; margin: 3px 5px; border-radius: 2px; color: #777; cursor: pointer; border-radius: 2px;}
|
||||
.layui-layedit-tool .layui-icon:hover{color: #393D49;}
|
||||
.layui-layedit-tool .layui-icon:active{color: #000;}
|
||||
.layui-layedit-tool .layedit-tool-active{background-color: #e2e2e2; color: #000;}
|
||||
.layui-layedit-tool .layedit-tool-active{background-color: #eee; color: #000;}
|
||||
.layui-layedit-tool .layui-disabled,
|
||||
.layui-layedit-tool .layui-disabled:hover{color: #d2d2d2; cursor: not-allowed;}
|
||||
.layui-layedit-tool .layedit-tool-mid{width: 1px; height: 18px; margin: 0 10px; background-color: #d2d2d2;}
|
||||
@@ -764,7 +798,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-laypage span,
|
||||
.layui-laypage input,
|
||||
.layui-laypage button,
|
||||
.layui-laypage select{border: 1px solid #e2e2e2;}
|
||||
.layui-laypage select{border: 1px solid #eee;}
|
||||
.layui-laypage a,
|
||||
.layui-laypage span{display: inline-block; *display: inline; *zoom: 1; vertical-align: middle; padding: 0 15px; height: 28px; line-height: 28px; margin: 0 -1px 5px 0; background-color: #fff; color: #333; font-size: 12px;}
|
||||
.layui-laypage a:hover{color: #009688;}
|
||||
@@ -816,7 +850,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-table[lay-even] tr:nth-child(even),
|
||||
.layui-table tbody tr:hover,
|
||||
.layui-table-hover,
|
||||
.layui-table-click{background-color: #f2f2f2;}
|
||||
.layui-table-click{background-color: #FAFAFA;}
|
||||
|
||||
.layui-table th,
|
||||
.layui-table td,
|
||||
@@ -830,7 +864,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-table-page,
|
||||
.layui-table-fixed-r,
|
||||
.layui-table-tips-main,
|
||||
.layui-table-grid-down{border-width: 1px; border-style: solid; border-color: #e6e6e6;}
|
||||
.layui-table-grid-down{border-width: 1px; border-style: solid; border-color: #eee;}
|
||||
|
||||
.layui-table th, .layui-table td{position: relative; padding: 9px 15px; min-height: 20px; line-height: 20px; font-size: 14px;}
|
||||
|
||||
@@ -875,7 +909,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-table-tool-panel{position: absolute; top: 29px; left: -1px; padding: 5px 0; min-width: 150px; min-height: 40px; border: 1px solid #d2d2d2; text-align: left; overflow-y: auto; background-color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.12);}
|
||||
.layui-table-tool-panel li{padding: 0 10px; line-height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-transition: .5s all; transition: .5s all;}
|
||||
.layui-table-tool-panel li .layui-form-checkbox[lay-skin="primary"]{width: 100%;}
|
||||
.layui-table-tool-panel li:hover{background-color: #f2f2f2;}
|
||||
.layui-table-tool-panel li:hover{background-color: #F6F6F6;}
|
||||
.layui-table-tool-panel li .layui-form-checkbox[lay-skin="primary"]{padding-left: 28px;}
|
||||
.layui-table-tool-panel li .layui-form-checkbox[lay-skin="primary"] i{position: absolute; left: 0; top: 0;}
|
||||
.layui-table-tool-panel li .layui-form-checkbox[lay-skin="primary"] span{padding: 0;}
|
||||
@@ -937,7 +971,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
|
||||
.layui-table-edit{position: absolute; left: 0; top: 0; width: 100%; height: 100%; padding: 0 14px 1px; border-radius: 0; box-shadow: 1px 1px 20px rgba(0,0,0,.15)}
|
||||
.layui-table-edit:focus{border-color: #5FB878!important;}
|
||||
select.layui-table-edit{padding: 0 0 0 10px; border-color: #C9C9C9;}
|
||||
select.layui-table-edit{padding: 0 0 0 10px; border-color: #d2d2d2;}
|
||||
.layui-table-view .layui-form-switch,
|
||||
.layui-table-view .layui-form-checkbox,
|
||||
.layui-table-view .layui-form-radio{top: 0; margin: 0; box-sizing: content-box;}
|
||||
@@ -968,10 +1002,71 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-upload-wrap{position: relative; display: inline-block; vertical-align: middle;}
|
||||
.layui-upload-wrap .layui-upload-file{display: block!important; position: absolute; left: 0; top: 0; z-index: 10; font-size: 100px; width: 100%; height: 100%; opacity: .01; filter: Alpha(opacity=1); cursor: pointer;}
|
||||
|
||||
|
||||
/* 基础菜单元素 */
|
||||
.layui-menu{position: relative; margin: 5px 0; background-color: #fff; box-sizing: border-box;}
|
||||
.layui-menu *{box-sizing: border-box;}
|
||||
.layui-menu li,
|
||||
.layui-menu-body-title a{padding: 5px 15px;}
|
||||
.layui-menu li{position: relative; margin: 1px 0; width: calc(100% + 1px); line-height: 22px; color: rgba(0,0,0,.8); font-size: 14px; white-space: nowrap; cursor: pointer; transition: all .3s;}
|
||||
.layui-menu li:hover{background-color: #F6F6F6; }
|
||||
|
||||
.layui-menu-item-parent:hover>.layui-menu-body-panel{display: block; animation-name: layui-fadein; animation-duration: 0.3s; animation-fill-mode: both; animation-delay:.2s;}
|
||||
.layui-menu-item-parent .layui-menu-body-title,
|
||||
.layui-menu-item-group .layui-menu-body-title{padding-right: 25px;}
|
||||
|
||||
.layui-menu .layui-menu-item-group:hover,
|
||||
.layui-menu .layui-menu-item-none:hover,
|
||||
.layui-menu .layui-menu-item-divider:hover{background: none; cursor: default;}
|
||||
.layui-menu .layui-menu-item-group>ul{margin: 5px 0 -5px;}
|
||||
.layui-menu .layui-menu-item-group>.layui-menu-body-title{color: rgba(0,0,0,.35); user-select: none;}
|
||||
.layui-menu .layui-menu-item-none{color: rgba(0,0,0,.35); cursor: default;}
|
||||
|
||||
.layui-menu .layui-menu-item-none{text-align: center;}
|
||||
.layui-menu .layui-menu-item-divider{margin: 5px 0; padding: 0; height: 0; line-height: 0; border-bottom: 1px solid #eee; overflow: hidden;}
|
||||
|
||||
.layui-menu .layui-menu-item-up:hover,
|
||||
.layui-menu .layui-menu-item-down:hover{cursor: pointer;}
|
||||
.layui-menu .layui-menu-item-up>.layui-menu-body-title{ color: rgba(0,0,0,.8);}
|
||||
.layui-menu .layui-menu-item-up>ul{visibility: hidden; height: 0; overflow: hidden;}
|
||||
.layui-menu .layui-menu-item-up>.layui-menu-body-title:hover>.layui-icon,
|
||||
.layui-menu .layui-menu-item-down:hover>.layui-menu-body-title>.layui-icon{color: rgba(0,0,0,1);}
|
||||
.layui-menu .layui-menu-item-down>ul{visibility: visible; height: auto;}
|
||||
|
||||
.layui-menu .layui-menu-item-checked,
|
||||
.layui-menu .layui-menu-item-checked2{background-color: #F6F6F6!important; color: #5FB878;}
|
||||
.layui-menu .layui-menu-item-checked a,
|
||||
.layui-menu .layui-menu-item-checked2 a{color: #5FB878;}
|
||||
.layui-menu .layui-menu-item-checked:after{position: absolute; right: 0; top: 0; bottom: 0; border-right: 3px solid #5FB878; content: "";}
|
||||
|
||||
.layui-menu-body-title{position: relative; overflow: hidden; text-overflow: ellipsis;}
|
||||
.layui-menu-body-title a{display: block; margin: -5px -15px; color: rgba(0,0,0,.8);}
|
||||
.layui-menu-body-title a:hover{transition: all .3s;}
|
||||
.layui-menu-body-title>.layui-icon{position: absolute; right: 0; top: 0; font-size: 14px;}
|
||||
.layui-menu-body-title>.layui-icon:hover{transition: all .3s;}
|
||||
.layui-menu-body-title>.layui-icon-right{right: -1px;}
|
||||
.layui-menu-body-panel{display: none; position: absolute; top: -7px; left: 100%; z-index: 1000; margin-left: 13px; padding: 5px 0;}
|
||||
.layui-menu-body-panel:before{content: ""; position: absolute; width: 20px; left: -16px; top: 0; bottom: 0;}
|
||||
.layui-menu-body-panel-left{left: auto; right: 100%; margin: 0 13px 0;}
|
||||
.layui-menu-body-panel-left:before{left: auto; right: -16px;}
|
||||
|
||||
.layui-menu-lg li{line-height: 32px;}
|
||||
.layui-menu-lg li:hover,
|
||||
.layui-menu-lg .layui-menu-body-title a:hover{background: none; color: #5FB878;}
|
||||
.layui-menu-lg li .layui-menu-body-panel{margin-left: 14px}
|
||||
.layui-menu-lg li .layui-menu-body-panel-left{margin: 0 15px 0;}
|
||||
|
||||
|
||||
/* 下拉菜单 */
|
||||
.layui-dropdown{position: absolute; left: -999999px; top: -999999px; z-index: 66666666; margin: 5px 0; min-width: 100px;}
|
||||
.layui-dropdown:before{content:""; position: absolute; width: 100%; height: 6px; left: 0; top: -6px;}
|
||||
|
||||
|
||||
|
||||
/** 穿梭框 **/
|
||||
.layui-transfer-box,
|
||||
.layui-transfer-header,
|
||||
.layui-transfer-search{border-width: 0; border-style: solid; border-color: #e6e6e6}
|
||||
.layui-transfer-search{border-width: 0; border-style: solid; border-color: #eee}
|
||||
.layui-transfer-box{position: relative; display: inline-block; vertical-align: middle; border-width: 1px; width: 200px; height: 360px; border-radius: 2px; background-color:#fff;}
|
||||
.layui-transfer-box .layui-form-checkbox{width: 100%; margin: 0 !important;}
|
||||
.layui-transfer-header{height: 38px; line-height: 38px; padding: 0 10px; border-bottom-width: 1px;}
|
||||
@@ -980,12 +1075,12 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-transfer-search .layui-icon-search{position: absolute; left: 20px; top: 50%; margin-top: -8px; color: #666;}
|
||||
.layui-transfer-active{margin: 0 15px; display: inline-block; vertical-align: middle;}
|
||||
.layui-transfer-active .layui-btn{display: block; margin: 0; padding: 0 15px; background-color: #5FB878; border-color: #5FB878; color: #fff;}
|
||||
.layui-transfer-active .layui-btn-disabled{background-color: #FBFBFB; border-color: #e6e6e6; color: #C9C9C9;}
|
||||
.layui-transfer-active .layui-btn-disabled{background-color: #FBFBFB; border-color: #eee; color: #d2d2d2;}
|
||||
.layui-transfer-active .layui-btn:first-child{margin-bottom: 15px;}
|
||||
.layui-transfer-active .layui-btn .layui-icon{margin: 0; font-size: 14px !important;}
|
||||
.layui-transfer-data{padding: 5px 0; overflow: auto;}
|
||||
.layui-transfer-data li{height: 32px; line-height: 32px; padding: 0 10px;}
|
||||
.layui-transfer-data li:hover{background-color: #f2f2f2; transition: .5s all;}
|
||||
.layui-transfer-data li:hover{background-color: #F6F6F6; transition: .5s all;}
|
||||
.layui-transfer-data .layui-none{padding: 15px 10px; text-align: center; color: #999;}
|
||||
|
||||
|
||||
@@ -1000,10 +1095,10 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-nav-bar{z-index: 1000;}
|
||||
.layui-nav .layui-this a
|
||||
,.layui-nav .layui-nav-item a:hover{color: #fff;}
|
||||
.layui-nav .layui-this:after{content: ''; top: auto; bottom: 0; width: 100%;}
|
||||
.layui-nav .layui-this:after{content: ""; top: auto; bottom: 0; width: 100%;}
|
||||
.layui-nav-img{width: 30px; height: 30px; margin-right: 10px; border-radius: 50%;}
|
||||
|
||||
.layui-nav .layui-nav-more{content:''; width: 0; height: 0; border-style: dashed; border-color: transparent; overflow: hidden; cursor: pointer; transition: all .2s; -webkit-transition: all .2s;}
|
||||
.layui-nav .layui-nav-more{content: ""; width: 0; height: 0; border-style: dashed; border-color: transparent; overflow: hidden; cursor: pointer; transition: all .2s; -webkit-transition: all .2s;}
|
||||
.layui-nav .layui-nav-more{position: absolute; top: 50%; right: 3px; margin-top: -4px; border-width: 6px; border-top-style: solid; border-top-color: #fff; border-top-color: rgba(255,255,255,.7);}
|
||||
.layui-nav .layui-nav-mored,
|
||||
.layui-nav-itemed > a .layui-nav-more{margin-top: -9px; border-style: dashed; border-color: transparent; border-bottom-style: solid; border-bottom-color: #fff;}
|
||||
@@ -1011,7 +1106,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
|
||||
.layui-nav-child{display: none; position: absolute; left: 0; top: 65px; min-width: 100%; line-height: 36px; padding: 5px 0; box-shadow: 0 2px 4px rgba(0,0,0,.12); border: 1px solid #d2d2d2; background-color: #fff; z-index: 100; border-radius: 2px; white-space: nowrap;}
|
||||
.layui-nav .layui-nav-child a{color: #333;}
|
||||
.layui-nav .layui-nav-child a:hover{background-color: #f2f2f2; color: #000;}
|
||||
.layui-nav .layui-nav-child a:hover{background-color: #F6F6F6; color: #5FB878;}
|
||||
.layui-nav-child dd{position: relative;}
|
||||
.layui-nav-child dd.layui-this{background-color: #5FB878; color: #fff;}
|
||||
.layui-nav .layui-nav-child dd.layui-this a{background-color: #5FB878; color: #fff;}
|
||||
@@ -1071,16 +1166,16 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-tab-title li a{display: block;}
|
||||
.layui-tab-title .layui-this{color: #000;}
|
||||
|
||||
.layui-tab-title .layui-this:after{position: absolute; left:0; top: 0; content: ''; width:100%; height: 41px; border-width: 1px; border-style: solid; border-bottom-color: #fff; border-radius: 2px 2px 0 0; box-sizing: border-box; pointer-events: none;}
|
||||
.layui-tab-title .layui-this:after{position: absolute; left:0; top: 0; content: ""; width:100%; height: 41px; border-width: 1px; border-style: solid; border-bottom-color: #fff; border-radius: 2px 2px 0 0; box-sizing: border-box; pointer-events: none;}
|
||||
.layui-tab-bar{position: absolute; right: 0; top: 0; z-index: 10; width: 30px; height: 39px; line-height: 39px; border-width: 1px; border-style: solid; border-radius: 2px; text-align: center; background-color: #fff; cursor: pointer;}
|
||||
.layui-tab-bar .layui-icon{position: relative; display: inline-block; top: 3px; transition: all .3s; -webkit-transition: all .3s;}
|
||||
.layui-tab-item{display: none;}
|
||||
.layui-tab-more{padding-right: 30px; height: auto !important; white-space: normal !important;}
|
||||
.layui-tab-more li.layui-this:after{border-bottom-color: #e2e2e2; border-radius: 2px;}
|
||||
.layui-tab-more li.layui-this:after{border-bottom-color: #eee; border-radius: 2px;}
|
||||
.layui-tab-more .layui-tab-bar .layui-icon{top: -2px; top: 3px\0; -webkit-transform: rotate(180deg); transform: rotate(180deg);}
|
||||
:root .layui-tab-more .layui-tab-bar .layui-icon{top: -2px\0/IE9;}
|
||||
|
||||
.layui-tab-content{padding: 10px;}
|
||||
.layui-tab-content{padding: 15px 0;}
|
||||
|
||||
/* Tab关闭 */.layui-tab-title li .layui-tab-close{position: relative; display: inline-block; width: 18px; height: 18px; line-height: 20px; margin-left: 8px; top: 1px; text-align: center; font-size: 14px; color: #c2c2c2; transition: all .2s; -webkit-transition: all .2s;}
|
||||
.layui-tab-title li .layui-tab-close:hover{border-radius: 2px; background-color: #FF5722; color: #fff;}
|
||||
@@ -1091,7 +1186,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-tab-brief[overflow] > .layui-tab-title .layui-this:after{top: -1px;}
|
||||
|
||||
/* Tab卡片风格 */.layui-tab-card{border-width: 1px; border-style: solid; border-radius: 2px; box-shadow: 0 2px 5px 0 rgba(0,0,0,.1);}
|
||||
.layui-tab-card > .layui-tab-title{ background-color: #f2f2f2;}
|
||||
.layui-tab-card > .layui-tab-title{background-color: #FAFAFA;}
|
||||
.layui-tab-card > .layui-tab-title li{margin-right: -1px; margin-left: -1px;}
|
||||
.layui-tab-card > .layui-tab-title .layui-this{background-color: #fff; }
|
||||
.layui-tab-card > .layui-tab-title .layui-this:after{border-top: none; border-width: 1px; border-bottom-color: #fff;}
|
||||
@@ -1104,7 +1199,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-timeline-item{position: relative; padding-bottom: 20px;}
|
||||
.layui-timeline-axis{position: absolute; left: -5px; top: 0; z-index: 10; width: 20px; height: 20px; line-height: 20px; background-color: #fff; color: #5FB878; border-radius: 50%; text-align: center; cursor: pointer;}
|
||||
.layui-timeline-axis:hover{color: #FF5722;}
|
||||
.layui-timeline-item:before{content: ''; position: absolute; left: 5px; top: 0; z-index: 0; width: 1px; height: 100%;}
|
||||
.layui-timeline-item:before{content: ""; position: absolute; left: 5px; top: 0; z-index: 0; width: 1px; height: 100%;}
|
||||
.layui-timeline-item:last-child:before{display: none;}
|
||||
.layui-timeline-item:first-child:before{display: block;}
|
||||
.layui-timeline-content{padding-left: 25px;;}
|
||||
@@ -1147,7 +1242,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-carousel[lay-indicator="outside"] .layui-carousel-ind ul{background-color: rgba(0,0,0,.5);}
|
||||
.layui-carousel[lay-indicator="none"] .layui-carousel-ind{display: none;}
|
||||
.layui-carousel-ind ul{display: inline-block; padding: 5px; background-color: rgba(0,0,0,.2); border-radius: 10px; -webkit-transition-duration: .3s; transition-duration: .3s;}
|
||||
.layui-carousel-ind li{display: inline-block; width: 10px; height: 10px; margin: 0 3px; font-size: 14px; background-color: #e2e2e2; background-color: rgba(255,255,255,.5); border-radius: 50%; cursor: pointer; -webkit-transition-duration: .3s; transition-duration: .3s;}
|
||||
.layui-carousel-ind li{display: inline-block; width: 10px; height: 10px; margin: 0 3px; font-size: 14px; background-color: #eee; background-color: rgba(255,255,255,.5); border-radius: 50%; cursor: pointer; -webkit-transition-duration: .3s; transition-duration: .3s;}
|
||||
.layui-carousel-ind li:hover{background-color: rgba(255,255,255,.7);}
|
||||
.layui-carousel-ind li.layui-this{background-color: #fff;}
|
||||
.layui-carousel>*[carousel-item]>.layui-this,
|
||||
@@ -1199,8 +1294,8 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.layui-util-face ul li{cursor: pointer; float: left; border: 1px solid #e8e8e8; height: 22px; width: 26px; overflow: hidden; margin: -1px 0 0 -1px; padding: 4px 2px; text-align: center;}
|
||||
.layui-util-face ul li:hover{position: relative; z-index: 2; border: 1px solid #eb7350; background: #fff9ec;}
|
||||
|
||||
/** 代码修饰器 **/
|
||||
.layui-code{position: relative; margin: 10px 0; padding: 15px; line-height: 20px; border: 1px solid #ddd; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;}
|
||||
/** 代码文本修饰 **/
|
||||
.layui-code{position: relative; margin: 10px 0; padding: 15px; line-height: 20px; border: 1px solid #eee; border-left-width: 6px; background-color: #FAFAFA; color: #333; font-family: Courier New; font-size: 12px;}
|
||||
|
||||
/** 评分组件 By star1029 **/
|
||||
.layui-rate,
|
||||
@@ -1212,7 +1307,7 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.layui-rate[readonly] li i:hover{cursor: default; transform: scale(1);}
|
||||
|
||||
/** 颜色选择器 By star1029 **/
|
||||
.layui-colorpicker{width: 26px; height: 26px; border: 1px solid #e6e6e6; padding: 5px; border-radius: 2px; line-height: 24px; display: inline-block; cursor: pointer; transition: all .3s; -webkit-transition: all .3s;}
|
||||
.layui-colorpicker{width: 26px; height: 26px; border: 1px solid #eee; padding: 5px; border-radius: 2px; line-height: 24px; display: inline-block; cursor: pointer; transition: all .3s; -webkit-transition: all .3s;}
|
||||
.layui-colorpicker:hover{border-color: #d2d2d2;}
|
||||
.layui-colorpicker.layui-colorpicker-lg{width: 34px; height: 34px; line-height: 32px;}
|
||||
.layui-colorpicker.layui-colorpicker-sm{width: 24px; height: 24px; line-height: 22px;}
|
||||
@@ -1246,7 +1341,7 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.layui-colorpicker-main-input input.layui-input{width: 150px; height: 30px; color: #666;}
|
||||
|
||||
/** 滑块 By star1029 **/
|
||||
.layui-slider{height: 4px; background: #e2e2e2; border-radius: 3px; position: relative; cursor: pointer;}
|
||||
.layui-slider{height: 4px; background: #eee; border-radius: 3px; position: relative; cursor: pointer;}
|
||||
.layui-slider-bar{border-radius: 3px; position: absolute; height: 100%;}
|
||||
.layui-slider-step{position: absolute; top: 0; width: 4px; height: 4px; border-radius: 50%; background: #FFF; -webkit-transform: translateX(-50%); transform: translateX(-50%);}
|
||||
.layui-slider-wrap{width: 36px; height: 36px; position: absolute; top: -16px; -webkit-transform: translateX(-50%); transform: translateX(-50%); z-index: 10; text-align: center;}
|
||||
@@ -1256,11 +1351,11 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.layui-slider-wrap-btn.layui-slider-hover{transform: scale(1.2);}
|
||||
.layui-slider-wrap-btn.layui-disabled:hover{transform: scale(1) !important;}
|
||||
.layui-slider-tips{position: absolute; top: -42px; z-index: 66666666; white-space:nowrap; display: none; -webkit-transform: translateX(-50%); transform: translateX(-50%); color: #FFF; background: #000; border-radius: 3px; height: 25px; line-height: 25px; padding: 0 10px;}
|
||||
.layui-slider-tips:after{content: ''; position: absolute; bottom: -12px; left: 50%; margin-left: -6px; width: 0; height: 0; border-width: 6px; border-style: solid; border-color: #000 transparent transparent transparent;}
|
||||
.layui-slider-input{width: 70px; height: 32px; border: 1px solid #e6e6e6; border-radius: 3px; font-size: 16px; line-height: 32px; position: absolute; right: 0; top: -14px;}
|
||||
.layui-slider-input-btn{position: absolute; top: 0; right: 0; width: 20px; height: 100%; border-left: 1px solid #d2d2d2;}
|
||||
.layui-slider-tips:after{content: ""; position: absolute; bottom: -12px; left: 50%; margin-left: -6px; width: 0; height: 0; border-width: 6px; border-style: solid; border-color: #000 transparent transparent transparent;}
|
||||
.layui-slider-input{width: 70px; height: 32px; border: 1px solid #eee; border-radius: 3px; font-size: 16px; line-height: 32px; position: absolute; right: 0; top: -14px;}
|
||||
.layui-slider-input-btn{position: absolute; top: 0; right: 0; width: 20px; height: 100%; border-left: 1px solid #eee;}
|
||||
.layui-slider-input-btn i{cursor: pointer; position: absolute; right: 0; bottom: 0; width: 20px; height: 50%; font-size: 12px; line-height: 16px; text-align: center; color: #999;}
|
||||
.layui-slider-input-btn i:first-child{top: 0; border-bottom: 1px solid #d2d2d2;}
|
||||
.layui-slider-input-btn i:first-child{top: 0; border-bottom: 1px solid #eee;}
|
||||
.layui-slider-input-txt{height: 100%; font-size: 14px;}
|
||||
.layui-slider-input-txt input{height: 100%; border: none;}
|
||||
.layui-slider-input-btn i:hover{color: #009688;}
|
||||
@@ -1283,13 +1378,13 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.layui-tree-set{width: 100%; position: relative;}
|
||||
.layui-tree-pack{display: none; padding-left: 20px; position: relative;}
|
||||
.layui-tree-line .layui-tree-pack{padding-left: 27px;}
|
||||
.layui-tree-line .layui-tree-set .layui-tree-set:after{content: ''; position: absolute; top: 14px; left: -9px; width: 17px; height: 0; border-top: 1px dotted #c0c4cc;}
|
||||
.layui-tree-line .layui-tree-set .layui-tree-set:after{content: ""; position: absolute; top: 14px; left: -9px; width: 17px; height: 0; border-top: 1px dotted #c0c4cc;}
|
||||
.layui-tree-entry{position: relative; padding: 3px 0; height: 20px; white-space: nowrap;}
|
||||
.layui-tree-entry:hover{background-color: #eee;}
|
||||
.layui-tree-line .layui-tree-entry:hover{background-color: rgba(0,0,0,0);}
|
||||
.layui-tree-line .layui-tree-entry:hover .layui-tree-txt{color: #999; text-decoration: underline; transition: 0.3s;}
|
||||
.layui-tree-main{display: inline-block; vertical-align: middle; cursor: pointer; padding-right: 10px;}
|
||||
.layui-tree-line .layui-tree-set:before{content: ''; position: absolute; top: 0; left: -9px; width: 0; height: 100%; border-left: 1px dotted #c0c4cc;}
|
||||
.layui-tree-line .layui-tree-set:before{content: ""; position: absolute; top: 0; left: -9px; width: 0; height: 100%; border-left: 1px dotted #c0c4cc;}
|
||||
.layui-tree-line .layui-tree-set.layui-tree-setLineShort:before{height: 13px;}
|
||||
.layui-tree-line .layui-tree-set.layui-tree-setHide:before{height: 0;}
|
||||
.layui-tree-iconClick{display: inline-block; vertical-align: middle; position: relative; height: 20px; line-height: 20px; margin: 0 10px; color: #c0c4cc;}
|
||||
@@ -1297,7 +1392,7 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.layui-tree-iconClick .layui-icon{font-size: 18px;}
|
||||
.layui-tree-icon .layui-icon{font-size: 12px; color: #666;}
|
||||
.layui-tree-iconArrow{padding: 0 5px;}
|
||||
.layui-tree-iconArrow:after{content: ''; position: absolute; left: 4px; top: 3px; z-index: 100; width: 0; height: 0; border-width: 5px; border-style: solid; border-color: transparent transparent transparent #c0c4cc; transition: 0.5s;}
|
||||
.layui-tree-iconArrow:after{content: ""; position: absolute; left: 4px; top: 3px; z-index: 100; width: 0; height: 0; border-width: 5px; border-style: solid; border-color: transparent transparent transparent #c0c4cc; transition: 0.5s;}
|
||||
.layui-tree-spread>.layui-tree-entry>.layui-tree-iconClick>.layui-tree-iconArrow:after{transform: rotate(90deg) translate(3px, 4px);}
|
||||
.layui-tree-txt{display: inline-block; vertical-align: middle; color: #555;}
|
||||
.layui-tree-search{margin-bottom: 15px; color: #666;}
|
||||
@@ -1312,13 +1407,14 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
|
||||
|
||||
/** 动画 **/
|
||||
.layui-anim{-webkit-animation-duration: 0.3s; animation-duration: 0.3s; -webkit-animation-fill-mode: both; animation-fill-mode: both;}
|
||||
.layui-anim{-webkit-animation-duration: 0.2s; -webkit-animation-fill-mode: both; animation-duration: 0.2s; animation-fill-mode: both;}
|
||||
.layui-anim.layui-icon{display: inline-block;}
|
||||
.layui-anim-loop{-webkit-animation-iteration-count: infinite; animation-iteration-count: infinite;}
|
||||
.layui-trans,
|
||||
.layui-trans a{transition: all .3s; -webkit-transition: all .3s;} /* 过度变换 */
|
||||
.layui-trans a{transition: all .2s; -webkit-transition: all .2s;} /* 过度变换 */
|
||||
|
||||
@-webkit-keyframes layui-rotate{ /* 循环旋转 */
|
||||
/* 循环旋转 */
|
||||
@-webkit-keyframes layui-rotate{
|
||||
from {-webkit-transform: rotate(0deg);}
|
||||
to {-webkit-transform: rotate(360deg);}
|
||||
}
|
||||
@@ -1328,7 +1424,8 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
}
|
||||
.layui-anim-rotate{-webkit-animation-name: layui-rotate; animation-name: layui-rotate; -webkit-animation-duration: 1s; animation-duration: 1s; -webkit-animation-timing-function: linear; animation-timing-function: linear;}
|
||||
|
||||
@-webkit-keyframes layui-up{ /* 从最底部往上滑入 */
|
||||
/* 从最底部往上滑入 */
|
||||
@-webkit-keyframes layui-up{
|
||||
from {-webkit-transform: translate3d(0, 100%, 0); opacity: 0.3;}
|
||||
to {-webkit-transform: translate3d(0, 0, 0); opacity: 1;}
|
||||
}
|
||||
@@ -1338,18 +1435,33 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
}
|
||||
.layui-anim-up{-webkit-animation-name: layui-up; animation-name: layui-up;}
|
||||
|
||||
@-webkit-keyframes layui-upbit{ /* 微微往上滑入 */
|
||||
from {-webkit-transform: translate3d(0, 30px, 0); opacity: 0.3;}
|
||||
/* 微微往上滑入 */
|
||||
@-webkit-keyframes layui-upbit{
|
||||
from {-webkit-transform: translate3d(0, 15px, 0); opacity: 0.3;}
|
||||
to {-webkit-transform: translate3d(0, 0, 0); opacity: 1;}
|
||||
}
|
||||
@keyframes layui-upbit{
|
||||
from {transform: translate3d(0, 30px, 0); opacity: 0.3;}
|
||||
from {transform: translate3d(0, 15px, 0); opacity: 0.3;}
|
||||
to {transform: translate3d(0, 0, 0); opacity: 1;}
|
||||
}
|
||||
.layui-anim-upbit{-webkit-animation-name: layui-upbit; animation-name: layui-upbit;}
|
||||
|
||||
/* 从最顶部往下滑入 */
|
||||
@keyframes layui-down {
|
||||
0% {opacity: 0.3; transform: translate3d(0, -100%, 0);}
|
||||
100% {opacity: 1; transform: translate3d(0, 0, 0);}
|
||||
}
|
||||
.layui-anim-down{animation-name: layui-down;}
|
||||
|
||||
@-webkit-keyframes layui-scale { /* 放大 */
|
||||
/* 微微往下滑入 */
|
||||
@keyframes layui-downbit {
|
||||
0% {opacity: 0.3; transform: translate3d(0, -5px, 0);}
|
||||
100% {opacity: 1; transform: translate3d(0, 0, 0);}
|
||||
}
|
||||
.layui-anim-downbit{animation-name: layui-downbit;}
|
||||
|
||||
/* 放大 */
|
||||
@-webkit-keyframes layui-scale {
|
||||
0% {opacity: 0.3; -webkit-transform: scale(.5);}
|
||||
100% {opacity: 1; -webkit-transform: scale(1);}
|
||||
}
|
||||
@@ -1359,7 +1471,8 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
}
|
||||
.layui-anim-scale{-webkit-animation-name: layui-scale; animation-name: layui-scale}
|
||||
|
||||
@-webkit-keyframes layui-scale-spring { /* 弹簧式放大 */
|
||||
/* 弹簧式放大 */
|
||||
@-webkit-keyframes layui-scale-spring {
|
||||
0% {opacity: 0.5; -webkit-transform: scale(.5);}
|
||||
80% {opacity: 0.8; -webkit-transform: scale(1.1);}
|
||||
100% {opacity: 1; -webkit-transform: scale(1);}
|
||||
@@ -1371,7 +1484,24 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
}
|
||||
.layui-anim-scaleSpring{-webkit-animation-name: layui-scale-spring; animation-name: layui-scale-spring}
|
||||
|
||||
@-webkit-keyframes layui-fadein { /* 渐现 */
|
||||
/* 放小 */
|
||||
@keyframes layui-scalesmall {
|
||||
0% {opacity: 0.3; transform: scale(1.5);}
|
||||
100% {opacity: 1; transform: scale(1);}
|
||||
}
|
||||
.layui-anim-scalesmall{animation-name: layui-scalesmall}
|
||||
|
||||
/* 弹簧式放小 */
|
||||
@keyframes layui-scalesmall-spring {
|
||||
0% {opacity: 0.3; transform: scale(1.5);}
|
||||
80% {opacity: 0.8; transform: scale(0.9);}
|
||||
100% {opacity: 1; transform: scale(1);}
|
||||
}
|
||||
.layui-anim-scalesmall-spring{animation-name: layui-scalesmall-spring}
|
||||
|
||||
|
||||
/* 渐显 */
|
||||
@-webkit-keyframes layui-fadein {
|
||||
0% {opacity: 0;}
|
||||
100% {opacity: 1;}
|
||||
}
|
||||
@@ -1379,9 +1509,10 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
0% {opacity: 0;}
|
||||
100% {opacity: 1;}
|
||||
}
|
||||
.layui-anim-fadein{-webkit-animation-name: layui-fadein; animation-name: layui-fadein}
|
||||
.layui-anim-fadein{-webkit-animation-name: layui-fadein; animation-name: layui-fadein;}
|
||||
|
||||
@-webkit-keyframes layui-fadeout { /* 渐隐 */
|
||||
/* 渐隐 */
|
||||
@-webkit-keyframes layui-fadeout {
|
||||
0% {opacity: 1;}
|
||||
100% {opacity: 0;}
|
||||
}
|
||||
@@ -1393,3 +1524,4 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
|
||||
@Name: layui.code
|
||||
@Author: 贤心
|
||||
@Site: http://www.layui.com
|
||||
@Description:Classic modular front-end UI framework
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
@@ -10,14 +10,20 @@
|
||||
html #layuicss-skincodecss{display:none; position: absolute; width:1989px;}
|
||||
|
||||
/* 默认风格 */
|
||||
.layui-code-view{display: block; position: relative; margin: 10px 0; padding: 0; border: 1px solid #e2e2e2; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;}
|
||||
.layui-code-h3{position: relative; padding: 0 10px; height: 32px; line-height: 32px; border-bottom: 1px solid #e2e2e2; font-size: 12px;}
|
||||
.layui-code-view{display: block; position: relative; margin: 10px 0; padding: 0; border: 1px solid #eee; border-left-width: 6px; background-color: #FAFAFA; color: #333; font-family: Courier New; font-size: 12px;}
|
||||
.layui-code-h3{position: relative; padding: 0 10px; height: 40px; line-height: 40px; border-bottom: 1px solid #eee; font-size: 12px;}
|
||||
.layui-code-h3 a{position: absolute; right: 10px; top: 0; color: #999;}
|
||||
.layui-code-view .layui-code-ol{position: relative; overflow: auto;}
|
||||
.layui-code-view .layui-code-ol li{position: relative; margin-left: 45px; line-height: 20px; padding: 0 5px; border-left: 1px solid #e2e2e2; list-style-type: decimal-leading-zero; *list-style-type: decimal; background-color: #fff;}
|
||||
.layui-code-view .layui-code-ol li{position: relative; margin-left: 45px; line-height: 20px; padding: 0 10px; border-left: 1px solid #e2e2e2; list-style-type: decimal-leading-zero; *list-style-type: decimal; background-color: #fff;}
|
||||
.layui-code-view .layui-code-ol li:first-child{padding-top: 10px;}
|
||||
.layui-code-view .layui-code-ol li:last-child{padding-bottom: 10px;}
|
||||
.layui-code-view pre{margin: 0;}
|
||||
|
||||
/* notepadd++风格 */
|
||||
.layui-code-notepad{border: 1px solid #0C0C0C; border-left-color: #3F3F3F; background-color: #0C0C0C; color: #C2BE9E}
|
||||
.layui-code-notepad .layui-code-h3{border-bottom: none;}
|
||||
.layui-code-notepad .layui-code-ol li{background-color: #3F3F3F; border-left: none;}
|
||||
.layui-code-notepad .layui-code-ol li{background-color: #3F3F3F; border-left: none;}
|
||||
|
||||
/* 代码预览 */
|
||||
.layui-code-demo .layui-code{visibility: visible !important; margin: -15px; border-top: none; border-right: none; border-bottom: none;}
|
||||
.layui-code-demo .layui-tab-content{padding: 15px; border-top: none}
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name: laydata
|
||||
@Author: 贤心
|
||||
|
||||
**/
|
||||
|
||||
@@ -13,21 +12,19 @@ html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
|
||||
|
||||
/* 主体结构 */
|
||||
.layui-laydate, .layui-laydate *{box-sizing: border-box;}
|
||||
.layui-laydate{position: absolute; z-index: 66666666; margin: 5px 0; border-radius: 2px; font-size: 14px; -webkit-animation-duration: 0.3s; animation-duration: 0.3s; -webkit-animation-fill-mode: both; animation-fill-mode: both;}
|
||||
.layui-laydate{position: absolute; z-index: 66666666; margin: 5px 0; border-radius: 2px; font-size: 14px; -webkit-animation-duration: 0.2s; animation-duration: 0.2s; -webkit-animation-fill-mode: both; animation-fill-mode: both;}
|
||||
.layui-laydate-main{width: 272px;}
|
||||
.layui-laydate-header *,
|
||||
.layui-laydate-content td,
|
||||
.layui-laydate-list li{transition-duration: .3s; -webkit-transition-duration: .3s;}
|
||||
|
||||
@-webkit-keyframes laydate-upbit{ /* 微微往上滑入 */
|
||||
from {-webkit-transform: translate3d(0, 20px, 0); opacity: 0.3;}
|
||||
to {-webkit-transform: translate3d(0, 0, 0); opacity: 1;}
|
||||
/* 微微往下滑入 */
|
||||
@keyframes laydate-downbit {
|
||||
0% {opacity: 0.3; transform: translate3d(0, -5px, 0);}
|
||||
100% {opacity: 1; transform: translate3d(0, 0, 0);}
|
||||
}
|
||||
@keyframes laydate-upbit{
|
||||
from {transform: translate3d(0, 20px, 0); opacity: 0.3;}
|
||||
to {transform: translate3d(0, 0, 0); opacity: 1;}
|
||||
}
|
||||
.layui-laydate{-webkit-animation-name: laydate-upbit; animation-name: laydate-upbit;}
|
||||
|
||||
.layui-laydate{animation-name: laydate-downbit;}
|
||||
.layui-laydate-static{ position: relative; z-index: 0; display: inline-block; margin: 0; -webkit-animation: none; animation: none;}
|
||||
|
||||
/* 展开年月列表时 */
|
||||
@@ -89,10 +86,7 @@ html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
|
||||
/* 双日历 */
|
||||
.layui-laydate-range{width: 546px;}
|
||||
.layui-laydate-range .layui-laydate-main{display: inline-block; vertical-align: middle;}
|
||||
.layui-laydate-range .laydate-main-list-0 .laydate-next-m,
|
||||
.layui-laydate-range .laydate-main-list-0 .laydate-next-y,
|
||||
.layui-laydate-range .laydate-main-list-1 .laydate-prev-y,
|
||||
.layui-laydate-range .laydate-main-list-1 .laydate-prev-m{display: none;}
|
||||
.layui-laydate-range .laydate-main-list-1 .layui-laydate-header,
|
||||
.layui-laydate-range .laydate-main-list-1 .layui-laydate-content{border-left: 1px solid #e2e2e2;}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name: layer
|
||||
@Author: 贤心
|
||||
|
||||
**/
|
||||
|
||||
@@ -51,8 +50,8 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
|
||||
@-webkit-keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:layer-shake;animation-name:layer-shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}
|
||||
|
||||
/* 标题栏 */
|
||||
.layui-layer-title{padding:0 80px 0 20px; height:42px; line-height:42px; border-bottom:1px solid #eee; font-size:14px; color:#333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background-color: #F8F8F8; border-radius: 2px 2px 0 0;}
|
||||
.layui-layer-setwin{position:absolute; right:15px; *right:0; top:15px; font-size:0; line-height: initial;}
|
||||
.layui-layer-title{padding:0 80px 0 20px; height: 50px; line-height: 50px; border-bottom:1px solid #F0F0F0; font-size: 14px; color:#333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 2px 2px 0 0;}
|
||||
.layui-layer-setwin{position:absolute; right: 15px; *right:0; top: 17px; font-size:0; line-height: initial;}
|
||||
.layui-layer-setwin a{position:relative; width: 16px; height:16px; margin-left:10px; font-size:12px; _overflow:hidden;}
|
||||
.layui-layer-setwin .layui-layer-min cite{position:absolute; width:14px; height:2px; left:0; top:50%; margin-top:-1px; background-color:#2E2D3C; cursor:pointer; _overflow:hidden;}
|
||||
.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA; }
|
||||
@@ -75,7 +74,7 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
|
||||
.layui-layer-btn-c{text-align: center;}
|
||||
|
||||
/* 定制化 */
|
||||
.layui-layer-dialog{min-width:260px;}
|
||||
.layui-layer-dialog{min-width: 300px;}
|
||||
.layui-layer-dialog .layui-layer-content{position: relative; padding:20px; line-height:24px; word-break: break-all; overflow:hidden; font-size:14px; overflow-x: hidden; overflow-y:auto;}
|
||||
.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute; top:16px; left:15px; _left:-40px; width:30px; height:30px;}
|
||||
.layui-layer-ico1{background-position:-30px 0 }
|
||||
@@ -129,7 +128,7 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
|
||||
.layui-layer-iconext{background:url(icon-ext.png) no-repeat;}
|
||||
|
||||
/* prompt模式 */
|
||||
.layui-layer-prompt .layui-layer-input{display: block; width: 230px; height: 36px; margin: 0 auto; line-height: 30px; padding-left: 10px; border: 1px solid #e6e6e6; color: #333;}
|
||||
.layui-layer-prompt .layui-layer-input{display: block; width: 260px; height: 36px; margin: 0 auto; line-height: 30px; padding-left: 10px; border: 1px solid #e6e6e6; color: #333;}
|
||||
.layui-layer-prompt textarea.layui-layer-input{width: 300px; height: 100px; line-height: 20px; padding: 6px 10px;}
|
||||
.layui-layer-prompt .layui-layer-content{padding: 20px;}
|
||||
.layui-layer-prompt .layui-layer-btn{padding-top: 0;}
|
||||
@@ -137,8 +136,8 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
|
||||
/* tab模式 */
|
||||
.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4);}
|
||||
.layui-layer-tab .layui-layer-title{padding-left:0; overflow: visible;}
|
||||
.layui-layer-tab .layui-layer-title span{position:relative; float:left; min-width:80px; max-width:260px; padding:0 20px; text-align:center; cursor:default; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; cursor: pointer;}
|
||||
.layui-layer-tab .layui-layer-title span.layui-this{height: 43px; border-left: 1px solid #eee; border-right: 1px solid #eee; background-color: #fff; z-index: 10;}
|
||||
.layui-layer-tab .layui-layer-title span{position:relative; float:left; min-width:80px; max-width: 300px; padding:0 20px; text-align:center; cursor:default; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; cursor: pointer;}
|
||||
.layui-layer-tab .layui-layer-title span.layui-this{height: 51px; border-left: 1px solid #eee; border-right: 1px solid #eee; background-color: #fff; z-index: 10;}
|
||||
.layui-layer-tab .layui-layer-title span:first-child{border-left:none;}
|
||||
.layui-layer-tabmain{line-height:24px; clear:both;}
|
||||
.layui-layer-tabmain .layui-layer-tabli{display:none;}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 777 B |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
74
src/layui.js
@@ -1,7 +1,7 @@
|
||||
/*!
|
||||
|
||||
@Name: layui
|
||||
@Description:经典模块化前端 UI 框架
|
||||
@Description:Classic modular front-end UI framework
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
|
||||
,Layui = function(){
|
||||
this.v = '2.5.7'; //版本号
|
||||
this.v = '2.6.0'; //版本号
|
||||
}
|
||||
|
||||
//获取layui所在目录
|
||||
@@ -38,37 +38,38 @@
|
||||
}()
|
||||
|
||||
//异常提示
|
||||
,error = function(msg){
|
||||
win.console && console.error && console.error('Layui hint: ' + msg);
|
||||
,error = function(msg, type){
|
||||
type = type || 'log';
|
||||
win.console && console[type] && console[type]('layui error hint: ' + msg);
|
||||
}
|
||||
|
||||
,isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]'
|
||||
|
||||
//内置模块
|
||||
,modules = {
|
||||
layer: 'modules/layer' //弹层
|
||||
,laydate: 'modules/laydate' //日期
|
||||
,laypage: 'modules/laypage' //分页
|
||||
,laytpl: 'modules/laytpl' //模板引擎
|
||||
,layim: 'modules/layim' //web通讯
|
||||
,layedit: 'modules/layedit' //富文本编辑器
|
||||
,form: 'modules/form' //表单集
|
||||
,upload: 'modules/upload' //上传
|
||||
,transfer: 'modules/transfer' //上传
|
||||
,tree: 'modules/tree' //树结构
|
||||
,table: 'modules/table' //表格
|
||||
,element: 'modules/element' //常用元素操作
|
||||
,rate: 'modules/rate' //评分组件
|
||||
,colorpicker: 'modules/colorpicker' //颜色选择器
|
||||
,slider: 'modules/slider' //滑块
|
||||
,carousel: 'modules/carousel' //轮播
|
||||
,flow: 'modules/flow' //流加载
|
||||
,util: 'modules/util' //工具块
|
||||
,code: 'modules/code' //代码修饰器
|
||||
,jquery: 'modules/jquery' //DOM库(第三方)
|
||||
lay: 'lay' //基础 DOM 操作
|
||||
,layer: 'layer' //弹层
|
||||
,laydate: 'laydate' //日期
|
||||
,laypage: 'laypage' //分页
|
||||
,laytpl: 'laytpl' //模板引擎
|
||||
,layedit: 'layedit' //富文本编辑器
|
||||
,form: 'form' //表单集
|
||||
,upload: 'upload' //上传
|
||||
,dropdown: 'dropdown' //下拉菜单
|
||||
,transfer: 'transfer' //穿梭框
|
||||
,tree: 'tree' //树结构
|
||||
,table: 'table' //表格
|
||||
,element: 'element' //常用元素操作
|
||||
,rate: 'rate' //评分组件
|
||||
,colorpicker: 'colorpicker' //颜色选择器
|
||||
,slider: 'slider' //滑块
|
||||
,carousel: 'carousel' //轮播
|
||||
,flow: 'flow' //流加载
|
||||
,util: 'util' //工具块
|
||||
,code: 'code' //代码修饰器
|
||||
,jquery: 'jquery' //DOM 库(第三方)
|
||||
|
||||
,mobile: 'modules/mobile' //移动大模块 | 若当前为开发目录,则为移动模块入口,否则为移动模块集合
|
||||
,'layui.all': '../layui.all' //PC模块合并版
|
||||
,'layui.all': '../layui' //聚合
|
||||
};
|
||||
|
||||
//记录基础数据
|
||||
@@ -97,10 +98,6 @@
|
||||
deps = []
|
||||
);
|
||||
|
||||
if((!layui['layui.all'] && layui['layui.mobile'])){
|
||||
return callback.call(that);
|
||||
}
|
||||
|
||||
that.use(deps, callback);
|
||||
return that;
|
||||
};
|
||||
@@ -138,7 +135,7 @@
|
||||
head.removeChild(node);
|
||||
(function poll() {
|
||||
if(++timeout > config.timeout * 1000 / 4){
|
||||
return error(item + ' is not a valid module');
|
||||
return error(item + ' is not a valid module', 'error');
|
||||
};
|
||||
config.status[item] ? onCallback() : setTimeout(poll, 4);
|
||||
}());
|
||||
@@ -153,10 +150,9 @@
|
||||
: ( typeof callback === 'function' && callback.apply(layui, exports) );
|
||||
}
|
||||
|
||||
//如果引入了完整库(layui.all.js),内置的模块则不必再加载
|
||||
//如果引入了聚合板,内置的模块则不必重复加载
|
||||
if(apps.length === 0
|
||||
|| (layui['layui.all'] && modules[item])
|
||||
|| (!layui['layui.all'] && layui['layui.mobile'] && modules[item])
|
||||
){
|
||||
return onCallback(), that;
|
||||
}
|
||||
@@ -166,10 +162,10 @@
|
||||
//如果是扩展模块,则判断模块路径值是否为 {/} 开头,
|
||||
//如果路径值是 {/} 开头,则模块路径即为后面紧跟的字符。
|
||||
//否则,则按照 base 参数拼接模块路径
|
||||
var url = ( modules[item] ? (dir + 'lay/')
|
||||
|
||||
var url = ( modules[item] ? (dir + 'modules/')
|
||||
: (/^\{\/\}/.test(that.modules[item]) ? '' : (config.base || ''))
|
||||
) + (that.modules[item] || item) + '.js';
|
||||
|
||||
url = url.replace(/^\{\/\}/, '');
|
||||
|
||||
//如果扩展模块(即:非内置模块)对象已经存在,则不必再加载
|
||||
@@ -206,7 +202,7 @@
|
||||
} else { //缓存
|
||||
(function poll() {
|
||||
if(++timeout > config.timeout * 1000 / 4){
|
||||
return error(item + ' is not a valid module');
|
||||
return error(item + ' is not a valid module', 'error');
|
||||
};
|
||||
(typeof config.modules[item] === 'string' && config.status[item])
|
||||
? onCallback()
|
||||
@@ -217,7 +213,7 @@
|
||||
return that;
|
||||
};
|
||||
|
||||
//获取节点的style属性值
|
||||
//获取节点的 style 属性值
|
||||
Layui.prototype.getStyle = function(node, name){
|
||||
var style = node.currentStyle ? node.currentStyle : win.getComputedStyle(node, null);
|
||||
return style[style.getPropertyValue ? 'getPropertyValue' : 'getAttribute'](name);
|
||||
@@ -232,7 +228,7 @@
|
||||
if(typeof fn === 'string') cssname = fn;
|
||||
|
||||
var app = (cssname || href).replace(/\.|\//g, '')
|
||||
,id = link.id = 'layuicss-'+app
|
||||
,id = link.id = 'layuicss-'+ app
|
||||
,timeout = 0;
|
||||
|
||||
link.rel = 'stylesheet';
|
||||
@@ -318,7 +314,7 @@
|
||||
options = options || {};
|
||||
for(var o in options){
|
||||
if(that[o] || that.modules[o]){
|
||||
error('\u6A21\u5757\u540D '+ o +' \u5DF2\u88AB\u5360\u7528');
|
||||
error(o+ ' Module already exists', 'error');
|
||||
} else {
|
||||
that.modules[o] = options[o];
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:用于打包PC完整版,即包含layui.js和所有模块的完整合并(该文件不会存在于构建后的目录)
|
||||
@Author:贤心
|
||||
@License:LGPL
|
||||
@Name:用于打包聚合版,该文件不会存在于构建后的目录
|
||||
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:layui.carousel 轮播模块
|
||||
@Author:贤心
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -24,7 +23,7 @@ layui.define('jquery', function(exports){
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件监听
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:layui.code 代码修饰器
|
||||
@Author:贤心
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -10,13 +9,12 @@ layui.define('jquery', function(exports){
|
||||
"use strict";
|
||||
|
||||
var $ = layui.$;
|
||||
var about = 'http://www.layui.com/doc/modules/code.html'; //关于信息
|
||||
|
||||
exports('code', function(options){
|
||||
var elems = [];
|
||||
options = options || {};
|
||||
options.elem = $(options.elem||'.layui-code');
|
||||
options.about = 'about' in options ? options.about : true;
|
||||
options.lang = 'lang' in options ? options.lang : 'code';
|
||||
|
||||
options.elem.each(function(){
|
||||
elems.push(this);
|
||||
@@ -34,7 +32,7 @@ layui.define('jquery', function(exports){
|
||||
othis.html('<ol class="layui-code-ol"><li>' + html.replace(/[\r\t\n]+/g, '</li><li>') + '</li></ol>')
|
||||
|
||||
if(!othis.find('>.layui-code-h3')[0]){
|
||||
othis.prepend('<h3 class="layui-code-h3">'+ (othis.attr('lay-title')||options.title||'code') + (options.about ? '<a href="'+ about +'" target="_blank">layui.code</a>' : '') + '</h3>');
|
||||
othis.prepend('<h3 class="layui-code-h3">'+ (othis.attr('lay-title')||options.title||'</>') + '<a href="javascript:;">'+ (othis.attr('lay-lang')||options.lang||'') +'</a>' + '</h3>');
|
||||
}
|
||||
|
||||
var ol = othis.find('>.layui-code-ol');
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Title: layui.colorpicker 颜色选择器
|
||||
@Author: star1029
|
||||
@Title: layui.colorpicker 颜色选择器组件
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -23,7 +22,7 @@ layui.define('jquery', function(exports){
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件监听
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, 'colorpicker', events, callback);
|
||||
}
|
||||
135
src/modules/demo.js
Normal file
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
|
||||
@Name:layui.MODULE_DEMO_NAME 模块组件通用结构
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
layui.define([''], function(exports){
|
||||
"use strict";
|
||||
|
||||
var $ = layui.$
|
||||
|
||||
//模块名
|
||||
,MOD_NAME = 'MODULE_DEMO_NAME'
|
||||
,MOD_INDEX = 'layui_'+ MOD_NAME +'_index' //模块索引名
|
||||
|
||||
//外部接口
|
||||
,MODULE_DEMO_NAME = {
|
||||
config: {}
|
||||
,index: layui[MOD_NAME] ? (layui[MOD_NAME].index + 10000) : 0
|
||||
|
||||
//设置全局项
|
||||
,set: function(options){
|
||||
var that = this;
|
||||
that.config = $.extend({}, that.config, options);
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
}
|
||||
|
||||
//操作当前实例
|
||||
,thisModule = function(){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,id = options.id || that.index;
|
||||
|
||||
thisModule.that[id] = that; //记录当前实例对象
|
||||
|
||||
return {
|
||||
config: options
|
||||
//重置实例
|
||||
,reload: function(options){
|
||||
that.reload.call(that, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//字符常量
|
||||
,STR_ELEM = 'layui-MODULE_DEMO_NAME', STR_HIDE = 'layui-hide', STR_DISABLED = 'layui-disabled', STR_NONE = 'layui-none'
|
||||
|
||||
//主模板
|
||||
,TPL_MAIN = [''].join('')
|
||||
|
||||
//构造器
|
||||
,Class = function(options){
|
||||
var that = this;
|
||||
that.index = ++MODULE_DEMO_NAME.index;
|
||||
that.config = $.extend({}, that.config, MODULE_DEMO_NAME.config, options);
|
||||
that.render();
|
||||
};
|
||||
|
||||
//默认配置
|
||||
Class.prototype.config = {
|
||||
|
||||
};
|
||||
|
||||
//重载实例
|
||||
Class.prototype.reload = function(options){
|
||||
var that = this;
|
||||
|
||||
layui.each(options, function(key, item){
|
||||
if(item.constructor === Array) delete that.config[key];
|
||||
});
|
||||
|
||||
that.config = $.extend(true, {}, that.config, options);
|
||||
that.render();
|
||||
};
|
||||
|
||||
//渲染
|
||||
Class.prototype.render = function(){
|
||||
var that = this
|
||||
,options = that.config;
|
||||
|
||||
//解析模板
|
||||
var thisElem = that.elem = $(laytpl(TPL_MAIN).render({
|
||||
data: options
|
||||
,index: that.index //索引
|
||||
}));
|
||||
|
||||
var othis = options.elem = $(options.elem);
|
||||
if(!othis[0]) return;
|
||||
|
||||
|
||||
|
||||
that.events(); //事件
|
||||
};
|
||||
|
||||
//事件
|
||||
Class.prototype.events = function(){
|
||||
var that = this
|
||||
,options = that.config;
|
||||
|
||||
|
||||
};
|
||||
|
||||
//记录所有实例
|
||||
thisModule.that = {}; //记录所有实例对象
|
||||
|
||||
//获取当前实例对象
|
||||
thisModule.getThis = function(id){
|
||||
var that = thisModule.that[id];
|
||||
if(!that) hint.error(id ? (MOD_NAME +' instance with ID \''+ id +'\' not found') : 'ID argument required');
|
||||
return that
|
||||
};
|
||||
|
||||
//重载实例
|
||||
MODULE_DEMO_NAME.reload = function(id, options){
|
||||
var that = thisModule.that[id];
|
||||
that.reload(options);
|
||||
|
||||
return thisModule.call(that);
|
||||
};
|
||||
|
||||
//核心入口
|
||||
MODULE_DEMO_NAME.render = function(options){
|
||||
var inst = new Class(options);
|
||||
return thisModule.call(inst);
|
||||
};
|
||||
|
||||
exports(MOD_NAME, MODULE_DEMO_NAME);
|
||||
});
|
||||
527
src/modules/dropdown.js
Normal file
@@ -0,0 +1,527 @@
|
||||
/**
|
||||
|
||||
@Name:layui.dropdown 下拉菜单组件
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
layui.define(['jquery', 'laytpl', 'lay'], function(exports){
|
||||
//"use strict";
|
||||
|
||||
var $ = layui.$
|
||||
,laytpl = layui.laytpl
|
||||
,hint = layui.hint()
|
||||
,device = layui.device()
|
||||
,clickOrMousedown = (device.mobile ? 'click' : 'mousedown')
|
||||
|
||||
//模块名
|
||||
,MOD_NAME = 'dropdown'
|
||||
,MOD_INDEX = 'layui_'+ MOD_NAME +'_index' //模块索引名
|
||||
|
||||
//外部接口
|
||||
,dropdown = {
|
||||
config: {}
|
||||
,index: layui[MOD_NAME] ? (layui[MOD_NAME].index + 10000) : 0
|
||||
|
||||
//设置全局项
|
||||
,set: function(options){
|
||||
var that = this;
|
||||
that.config = $.extend({}, that.config, options);
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
}
|
||||
|
||||
//操作当前实例
|
||||
,thisModule = function(){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,id = options.id;
|
||||
|
||||
thisModule.that[id] = that; //记录当前实例对象
|
||||
|
||||
return {
|
||||
config: options
|
||||
//重置实例
|
||||
,reload: function(options){
|
||||
that.reload.call(that, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//字符常量
|
||||
,STR_ELEM = 'layui-dropdown', STR_HIDE = 'layui-hide', STR_DISABLED = 'layui-disabled', STR_NONE = 'layui-none'
|
||||
,STR_ITEM_UP = 'layui-menu-item-up', STR_ITEM_DOWN = 'layui-menu-item-down', STR_MENU_TITLE = 'layui-menu-body-title', STR_ITEM_GROUP = 'layui-menu-item-group', STR_ITEM_PARENT = 'layui-menu-item-parent', STR_ITEM_DIV = 'layui-menu-item-divider', STR_ITEM_CHECKED = 'layui-menu-item-checked', STR_ITEM_CHECKED2 = 'layui-menu-item-checked2', STR_MENU_PANEL = 'layui-menu-body-panel', STR_MENU_PANEL_L = 'layui-menu-body-panel-left'
|
||||
|
||||
,STR_GROUP_TITLE = '.'+ STR_ITEM_GROUP + '>.'+ STR_MENU_TITLE
|
||||
|
||||
//构造器
|
||||
,Class = function(options){
|
||||
var that = this;
|
||||
that.index = ++dropdown.index;
|
||||
that.config = $.extend({}, that.config, dropdown.config, options);
|
||||
that.init();
|
||||
};
|
||||
|
||||
//默认配置
|
||||
Class.prototype.config = {
|
||||
trigger: 'click' //事件类型
|
||||
,content: '' //自定义菜单内容
|
||||
,className: '' //自定义样式类名
|
||||
,style: '' //设置面板 style 属性
|
||||
,show: false //是否初始即显示菜单面板
|
||||
,isAllowSpread: true //是否允许菜单组展开收缩
|
||||
,isSpreadItem: true //是否初始展开子菜单
|
||||
,data: [] //菜单数据结构
|
||||
,delay: 300 //延迟关闭的毫秒数,若 trigger 为 hover 时才生效
|
||||
};
|
||||
|
||||
//重载实例
|
||||
Class.prototype.reload = function(options){
|
||||
var that = this;
|
||||
that.config = $.extend({}, that.config, options);
|
||||
that.init(true);
|
||||
};
|
||||
|
||||
//初始化准备
|
||||
Class.prototype.init = function(rerender){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,elem = options.elem = $(options.elem);
|
||||
|
||||
//若 elem 非唯一
|
||||
if(elem.length > 1){
|
||||
layui.each(elem, function(){
|
||||
dropdown.render($.extend({}, options, {
|
||||
elem: this
|
||||
}));
|
||||
});
|
||||
return that;
|
||||
}
|
||||
|
||||
//若重复执行 render,则视为 reload 处理
|
||||
if(!rerender && elem[0] && elem.data(MOD_INDEX)){;
|
||||
var newThat = thisModule.getThis(elem.data(MOD_INDEX));
|
||||
if(!newThat) return;
|
||||
|
||||
return newThat.reload(options);
|
||||
};
|
||||
|
||||
//初始化 id 参数
|
||||
options.id = ('id' in options) ? options.id : that.index;
|
||||
|
||||
if(options.show) that.render(rerender); //初始即显示
|
||||
that.events(); //事件
|
||||
};
|
||||
|
||||
//渲染
|
||||
Class.prototype.render = function(rerender){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,elemBody = $('body')
|
||||
|
||||
//默认菜单内容
|
||||
,getDefaultView = function(){
|
||||
var elemUl = $('<ul class="layui-menu layui-dropdown-menu"></ul>');
|
||||
if(options.data.length > 0 ){
|
||||
eachItemView(elemUl, options.data)
|
||||
} else {
|
||||
elemUl.html('<li class="layui-menu-item-none">no menu</li>');
|
||||
}
|
||||
return elemUl;
|
||||
}
|
||||
|
||||
//遍历菜单项
|
||||
,eachItemView = function(views, data){
|
||||
//var views = [];
|
||||
layui.each(data, function(index, item){
|
||||
//是否存在子级
|
||||
var isChild = item.child && item.child.length > 0
|
||||
,isSpreadItem = ('isSpreadItem' in item) ? item.isSpreadItem : options.isSpreadItem
|
||||
,title = item.templet
|
||||
? laytpl(item.templet).render(item)
|
||||
: (options.templet ? laytpl(options.templet).render(item) : item.title)
|
||||
|
||||
//初始类型
|
||||
,type = function(){
|
||||
if(isChild){
|
||||
item.type = item.type || 'parent';
|
||||
}
|
||||
if(item.type){
|
||||
return ({
|
||||
group: 'group'
|
||||
,parent: 'parent'
|
||||
,'-': '-'
|
||||
})[item.type] || 'parent';
|
||||
}
|
||||
return '';
|
||||
}();
|
||||
|
||||
if(type !== '-' && (!item.title && !item.id && !isChild)) return;
|
||||
|
||||
//列表元素
|
||||
var viewLi = $(['<li'+ function(){
|
||||
var className = {
|
||||
group: 'layui-menu-item-group'+ (
|
||||
options.isAllowSpread ? (
|
||||
isSpreadItem ? ' layui-menu-item-down' : ' layui-menu-item-up'
|
||||
) : ''
|
||||
)
|
||||
,parent: STR_ITEM_PARENT
|
||||
,'-': 'layui-menu-item-divider'
|
||||
};
|
||||
if(isChild || type){
|
||||
return ' class="'+ className[type] +'"';
|
||||
}
|
||||
return '';
|
||||
}() +'>'
|
||||
|
||||
//标题区
|
||||
,function(){
|
||||
//是否超文本
|
||||
var viewText = ('href' in item) ? (
|
||||
'<a href="'+ item.href +'" target="'+ (item.target || '_self') +'">'+ title +'</a>'
|
||||
) : title;
|
||||
|
||||
//是否存在子级
|
||||
if(isChild){
|
||||
return '<div class="'+ STR_MENU_TITLE +'">'+ viewText + function(){
|
||||
if(type === 'parent'){
|
||||
return '<i class="layui-icon layui-icon-right"></i>';
|
||||
} else if(type === 'group' && options.isAllowSpread){
|
||||
return '<i class="layui-icon layui-icon-'+ (isSpreadItem ? 'up' : 'down') +'"></i>';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}() +'</div>'
|
||||
|
||||
}
|
||||
return '<div class="'+ STR_MENU_TITLE +'">'+ viewText +'</div>';
|
||||
}()
|
||||
,'</li>'].join(''));
|
||||
|
||||
viewLi.data('item', item);
|
||||
|
||||
//子级区
|
||||
if(isChild){
|
||||
var elemPanel = $('<div class="layui-panel layui-menu-body-panel"></div>')
|
||||
,elemUl = $('<ul></ul>');
|
||||
|
||||
if(type === 'parent'){
|
||||
elemPanel.append(eachItemView(elemUl, item.child));
|
||||
viewLi.append(elemPanel);
|
||||
} else {
|
||||
viewLi.append(eachItemView(elemUl, item.child));
|
||||
}
|
||||
}
|
||||
|
||||
views.append(viewLi);
|
||||
});
|
||||
return views;
|
||||
}
|
||||
|
||||
//主模板
|
||||
,TPL_MAIN = ['<div class="layui-dropdown layui-border-box layui-panel layui-anim layui-anim-downbit">'
|
||||
,'</div>'].join('');
|
||||
|
||||
//如果是右键事件,则每次触发事件时,将允许重新渲染
|
||||
if(options.trigger === 'contextmenu' || lay.isTopElem(options.elem[0])) rerender = true;
|
||||
|
||||
//判断是否已经打开了下拉菜单面板
|
||||
if(!rerender && options.elem.data(MOD_INDEX +'_opened')) return;
|
||||
|
||||
//记录模板对象
|
||||
that.elemView = $(TPL_MAIN);
|
||||
that.elemView.append(options.content || getDefaultView());
|
||||
|
||||
//初始化某些属性
|
||||
if(options.className) that.elemView.addClass(options.className);
|
||||
if(options.style) that.elemView.attr('style', options.style);
|
||||
|
||||
|
||||
//记录当前执行的实例索引
|
||||
dropdown.thisId = options.id;
|
||||
|
||||
//插入视图
|
||||
that.remove(); //移除非当前绑定元素的面板
|
||||
elemBody.append(that.elemView);
|
||||
options.elem.data(MOD_INDEX +'_opened', true);
|
||||
|
||||
//坐标定位
|
||||
that.position();
|
||||
thisModule.prevElem = that.elemView; //记录当前打开的元素,以便在下次关闭
|
||||
thisModule.prevElem.data('prevElem', options.elem); //将当前绑定的元素,记录在打开元素的 data 对象中
|
||||
|
||||
//阻止全局事件
|
||||
that.elemView.find('.layui-menu').on(clickOrMousedown, function(e){
|
||||
lay.stope(e);
|
||||
});
|
||||
|
||||
//触发菜单列表事件
|
||||
that.elemView.find('.layui-menu li').on('click', function(e){
|
||||
var othis = $(this)
|
||||
,data = othis.data('item') || {}
|
||||
,isChild = data.child && data.child.length > 0;
|
||||
|
||||
if(!isChild && data.type !== '-'){
|
||||
that.remove();
|
||||
typeof options.click === 'function' && options.click(data, othis);
|
||||
}
|
||||
});
|
||||
|
||||
//触发菜单组展开收缩
|
||||
that.elemView.find(STR_GROUP_TITLE).on('click', function(e){
|
||||
var othis = $(this)
|
||||
,elemGroup = othis.parent()
|
||||
,data = elemGroup.data('item') || {}
|
||||
|
||||
if(data.type === 'group' && options.isAllowSpread){
|
||||
thisModule.spread(elemGroup);
|
||||
}
|
||||
});
|
||||
|
||||
//如果是鼠标移入事件,则鼠标移出时自动关闭
|
||||
if(options.trigger === 'mouseenter'){
|
||||
that.elemView.on('mouseenter', function(){
|
||||
clearTimeout(thisModule.timer);
|
||||
}).on('mouseleave', function(){
|
||||
that.delayRemove();
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//位置定位
|
||||
Class.prototype.position = function(obj){
|
||||
var that = this
|
||||
,options = that.config;
|
||||
|
||||
lay.position(options.elem[0], that.elemView[0], {
|
||||
position: options.position
|
||||
,e: that.e
|
||||
,clickType: options.trigger === 'contextmenu' ? 'right' : null
|
||||
});
|
||||
};
|
||||
|
||||
//删除视图
|
||||
Class.prototype.remove = function(){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,elemPrev = thisModule.prevElem;
|
||||
|
||||
//若存在已打开的面板元素,则移除
|
||||
if(elemPrev){
|
||||
elemPrev.data('prevElem') && (
|
||||
elemPrev.data('prevElem').data(MOD_INDEX +'_opened', false)
|
||||
);
|
||||
elemPrev.remove();
|
||||
}
|
||||
};
|
||||
|
||||
//延迟删除视图
|
||||
Class.prototype.delayRemove = function(){
|
||||
var that = this
|
||||
,options = that.config;
|
||||
clearTimeout(thisModule.timer);
|
||||
|
||||
thisModule.timer = setTimeout(function(){
|
||||
that.remove();
|
||||
}, options.delay);
|
||||
};
|
||||
|
||||
//事件
|
||||
Class.prototype.events = function(){
|
||||
var that = this
|
||||
,options = that.config;
|
||||
|
||||
//如果传入 hover,则解析为 mouseenter
|
||||
if(options.trigger === 'hover') options.trigger = 'mouseenter';
|
||||
|
||||
//解除上一个事件
|
||||
if(that.prevElem) that.prevElem.off(options.trigger, that.prevElemCallback);
|
||||
|
||||
//记录被绑定的元素及回调
|
||||
that.prevElem = options.elem;
|
||||
that.prevElemCallback = function(e){
|
||||
clearTimeout(thisModule.timer);
|
||||
that.e = e;
|
||||
that.render();
|
||||
e.preventDefault();
|
||||
|
||||
//组件打开完毕的时间
|
||||
typeof options.ready === 'function' && options.ready(that.elemView, options.elem, that.e.target);
|
||||
};
|
||||
|
||||
//触发元素事件
|
||||
options.elem.on(options.trigger, that.prevElemCallback);
|
||||
|
||||
//如果是鼠标移入事件
|
||||
if(options.trigger === 'mouseenter'){
|
||||
//直行鼠标移出事件
|
||||
options.elem.on('mouseleave', function(){
|
||||
that.delayRemove();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//记录所有实例
|
||||
thisModule.that = {}; //记录所有实例对象
|
||||
|
||||
//获取当前实例对象
|
||||
thisModule.getThis = function(id){
|
||||
var that = thisModule.that[id];
|
||||
if(!that) hint.error(id ? (MOD_NAME +' instance with ID \''+ id +'\' not found') : 'ID argument required');
|
||||
return that;
|
||||
};
|
||||
|
||||
//设置菜单组展开和收缩状态
|
||||
thisModule.spread = function(othis){
|
||||
//菜单组展开和收缩
|
||||
var elemIcon = othis.children('.'+ STR_MENU_TITLE).find('.layui-icon');
|
||||
if(othis.hasClass(STR_ITEM_UP)){
|
||||
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')
|
||||
}
|
||||
};
|
||||
|
||||
//全局事件
|
||||
;!function(){
|
||||
var _WIN = $(window)
|
||||
,_DOC = $(document);
|
||||
|
||||
//自适应定位
|
||||
_WIN.on('resize', function(){
|
||||
if(!dropdown.thisId) return;
|
||||
var that = thisModule.getThis(dropdown.thisId);
|
||||
if(!that) return;
|
||||
|
||||
if(!that.elemView[0] || !$('.'+ STR_ELEM)[0]){
|
||||
return false;
|
||||
}
|
||||
|
||||
var options = that.config;
|
||||
|
||||
if(options.trigger === 'contextmenu'){
|
||||
that.remove();
|
||||
} else {
|
||||
that.position();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//点击任意处关闭
|
||||
_DOC.on(clickOrMousedown, function(e){
|
||||
if(!dropdown.thisId) return;
|
||||
var that = thisModule.getThis(dropdown.thisId)
|
||||
if(!that) return;
|
||||
|
||||
var options = that.config;
|
||||
|
||||
//如果触发的是绑定的元素,或者属于绑定元素的子元素,则不关闭
|
||||
//满足条件:当前绑定的元素不是 body document,或者不是鼠标右键事件
|
||||
if(!(lay.isTopElem(options.elem[0]) || options.trigger === 'contextmenu')){
|
||||
if(
|
||||
e.target === options.elem[0] ||
|
||||
options.elem.find(e.target)[0] ||
|
||||
e.target === that.elemView[0] ||
|
||||
(that.elemView && that.elemView.find(e.target)[0])
|
||||
) return;
|
||||
}
|
||||
|
||||
that.remove();
|
||||
});
|
||||
|
||||
//基础菜单的静态元素事件
|
||||
var ELEM_LI = '.layui-menu:not(.layui-dropdown-menu) li';
|
||||
_DOC.on('click', ELEM_LI, function(e){
|
||||
var othis = $(this)
|
||||
,parent = othis.parents('.layui-menu').eq(0)
|
||||
,isChild = othis.hasClass(STR_ITEM_GROUP) || othis.hasClass(STR_ITEM_PARENT)
|
||||
,filter = parent.attr('lay-filter') || parent.attr('id')
|
||||
,options = lay.options(this);
|
||||
|
||||
//非触发元素
|
||||
if(othis.hasClass(STR_ITEM_DIV)) return;
|
||||
|
||||
//非菜单组
|
||||
if(!isChild){
|
||||
//选中
|
||||
parent.find('.'+ STR_ITEM_CHECKED).removeClass(STR_ITEM_CHECKED); //清除选中样式
|
||||
parent.find('.'+ STR_ITEM_CHECKED2).removeClass(STR_ITEM_CHECKED2); //清除父级菜单选中样式
|
||||
othis.addClass(STR_ITEM_CHECKED); //添加选中样式
|
||||
othis.parents('.'+ STR_ITEM_PARENT).addClass(STR_ITEM_CHECKED2); //添加父级菜单选中样式
|
||||
|
||||
//触发事件
|
||||
layui.event.call(this, MOD_NAME, 'click('+ filter +')', options);
|
||||
}
|
||||
});
|
||||
|
||||
//基础菜单的展开收缩事件
|
||||
_DOC.on('click', (ELEM_LI + STR_GROUP_TITLE), function(e){
|
||||
var othis = $(this)
|
||||
,elemGroup = othis.parents('.'+ STR_ITEM_GROUP +':eq(0)')
|
||||
,options = lay.options(elemGroup[0]);
|
||||
|
||||
if(('isAllowSpread' in options) ? options.isAllowSpread : true){
|
||||
thisModule.spread(elemGroup);
|
||||
};
|
||||
});
|
||||
|
||||
//判断子级菜单是否超出屏幕
|
||||
var ELEM_LI_PAR = '.layui-menu .'+ STR_ITEM_PARENT
|
||||
_DOC.on('mouseenter', ELEM_LI_PAR, function(e){
|
||||
var othis = $(this)
|
||||
,elemPanel = othis.find('.'+ STR_MENU_PANEL);
|
||||
|
||||
if(!elemPanel[0]) return;
|
||||
var rect = elemPanel[0].getBoundingClientRect();
|
||||
|
||||
//是否超出右侧屏幕
|
||||
if(rect.right > _WIN.width()){
|
||||
elemPanel.addClass(STR_MENU_PANEL_L);
|
||||
//不允许超出左侧屏幕
|
||||
rect = elemPanel[0].getBoundingClientRect();
|
||||
if(rect.left < 0){
|
||||
elemPanel.removeClass(STR_MENU_PANEL_L);
|
||||
}
|
||||
}
|
||||
|
||||
//是否超出底部屏幕
|
||||
if(rect.bottom > _WIN.height()){
|
||||
elemPanel.eq(0).css('margin-top', -(rect.bottom - _WIN.height()));
|
||||
};
|
||||
}).on('mouseleave', ELEM_LI_PAR, function(e){
|
||||
var othis = $(this)
|
||||
,elemPanel = othis.children('.'+ STR_MENU_PANEL);
|
||||
|
||||
elemPanel.removeClass(STR_MENU_PANEL_L);
|
||||
elemPanel.css('margin-top', 0);
|
||||
});
|
||||
|
||||
}();
|
||||
|
||||
//重载实例
|
||||
dropdown.reload = function(id, options){
|
||||
var that = thisModule.getThis(id);
|
||||
if(!that) return this;
|
||||
|
||||
that.reload(options);
|
||||
return thisModule.call(that);
|
||||
};
|
||||
|
||||
//核心入口
|
||||
dropdown.render = function(options){
|
||||
var inst = new Class(options);
|
||||
return thisModule.call(inst);
|
||||
};
|
||||
|
||||
exports(MOD_NAME, dropdown);
|
||||
});
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:layui.element 常用元素操作
|
||||
@Author:贤心
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -26,7 +25,7 @@ layui.define('jquery', function(exports){
|
||||
return that;
|
||||
};
|
||||
|
||||
//表单事件监听
|
||||
//表单事件
|
||||
Element.prototype.on = function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
};
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:layui.flow 流加载
|
||||
@Author:贤心
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:layui.form 表单组件
|
||||
@Author:贤心
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -65,7 +64,7 @@ layui.define('layer', function(exports){
|
||||
return that;
|
||||
};
|
||||
|
||||
//表单事件监听
|
||||
//表单事件
|
||||
Form.prototype.on = function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v1.12.3
|
||||
* jQuery JavaScript Library v1.12.4
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
@@ -9,7 +9,7 @@
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2016-04-05T19:16Z
|
||||
* Date: 2016-05-20T17:17Z
|
||||
*/
|
||||
|
||||
(function( global, factory ) {
|
||||
@@ -65,7 +65,7 @@ var support = {};
|
||||
|
||||
|
||||
var
|
||||
version = "1.12.3",
|
||||
version = "1.12.4",
|
||||
|
||||
// Define a local copy of jQuery
|
||||
jQuery = function( selector, context ) {
|
||||
@@ -6672,6 +6672,7 @@ var documentElement = document.documentElement;
|
||||
if ( reliableHiddenOffsetsVal ) {
|
||||
div.style.display = "";
|
||||
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
|
||||
div.childNodes[ 0 ].style.borderCollapse = "separate";
|
||||
contents = div.getElementsByTagName( "td" );
|
||||
contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
|
||||
reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
|
||||
@@ -6996,19 +6997,6 @@ function getWidthOrHeight( elem, name, extra ) {
|
||||
isBorderBox = support.boxSizing &&
|
||||
jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
|
||||
|
||||
// Support: IE11 only
|
||||
// In IE 11 fullscreen elements inside of an iframe have
|
||||
// 100x too small dimensions (gh-1764).
|
||||
if ( document.msFullscreenElement && window.top !== window ) {
|
||||
|
||||
// Support: IE11 only
|
||||
// Running getBoundingClientRect on a disconnected node
|
||||
// in IE throws an error.
|
||||
if ( elem.getClientRects().length ) {
|
||||
val = Math.round( elem.getBoundingClientRect()[ name ] * 100 );
|
||||
}
|
||||
}
|
||||
|
||||
// some non-html elements return undefined for offsetWidth, so check for null/undefined
|
||||
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
|
||||
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
|
||||
@@ -9999,6 +9987,11 @@ function getDisplay( elem ) {
|
||||
}
|
||||
|
||||
function filterHidden( elem ) {
|
||||
|
||||
// Disconnected elements are considered hidden
|
||||
if ( !jQuery.contains( elem.ownerDocument || document, elem ) ) {
|
||||
return true;
|
||||
}
|
||||
while ( elem && elem.nodeType === 1 ) {
|
||||
if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) {
|
||||
return true;
|
||||
@@ -10977,6 +10970,7 @@ jQuery.fn.andSelf = jQuery.fn.addBack;
|
||||
// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
|
||||
|
||||
|
||||
|
||||
//将jQuery对象局部暴露给layui
|
||||
layui.define(function(exports){
|
||||
layui.$ = jQuery;
|
||||
456
src/modules/lay.js
Normal file
@@ -0,0 +1,456 @@
|
||||
/** lay 基础 DOM 操作 */
|
||||
|
||||
;!function(){
|
||||
"use strict";
|
||||
|
||||
var MOD_NAME = 'lay' //模块名
|
||||
,document = window.document
|
||||
|
||||
//DOM查找
|
||||
,lay = function(selector){
|
||||
return new LAY(selector);
|
||||
}
|
||||
|
||||
//DOM构造器
|
||||
,LAY = function(selector){
|
||||
var index = 0
|
||||
,nativeDOM = typeof selector === 'object' ? [selector] : (
|
||||
this.selector = selector
|
||||
,document.querySelectorAll(selector || null)
|
||||
);
|
||||
for(; index < nativeDOM.length; index++){
|
||||
this.push(nativeDOM[index]);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
lay 对象操作
|
||||
*/
|
||||
|
||||
LAY.prototype = [];
|
||||
LAY.prototype.constructor = LAY;
|
||||
|
||||
//普通对象深度扩展
|
||||
lay.extend = function(){
|
||||
var ai = 1, args = arguments
|
||||
,clone = function(target, obj){
|
||||
target = target || (obj.constructor === Array ? [] : {});
|
||||
for(var i in obj){
|
||||
//如果值为对象,则进入递归,继续深度合并
|
||||
target[i] = (obj[i] && (obj[i].constructor === Object))
|
||||
? clone(target[i], obj[i])
|
||||
: obj[i];
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
args[0] = typeof args[0] === 'object' ? args[0] : {};
|
||||
|
||||
for(; ai < args.length; ai++){
|
||||
if(typeof args[ai] === 'object'){
|
||||
clone(args[0], args[ai])
|
||||
}
|
||||
}
|
||||
return args[0];
|
||||
};
|
||||
|
||||
//lay 模块版本
|
||||
lay.v = '1.0.0';
|
||||
|
||||
//ie版本
|
||||
lay.ie = function(){
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
return (!!window.ActiveXObject || "ActiveXObject" in window) ? (
|
||||
(agent.match(/msie\s(\d+)/) || [])[1] || '11' //由于ie11并没有msie的标识
|
||||
) : false;
|
||||
}();
|
||||
|
||||
//获取当前 JS 所在目录
|
||||
lay.getPath = function(){
|
||||
var jsPath = document.currentScript ? document.currentScript.src : function(){
|
||||
var js = document.scripts
|
||||
,last = js.length - 1
|
||||
,src;
|
||||
for(var i = last; i > 0; i--){
|
||||
if(js[i].readyState === 'interactive'){
|
||||
src = js[i].src;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return src || js[last].src;
|
||||
}();
|
||||
return jsPath.substring(0, jsPath.lastIndexOf('/') + 1);
|
||||
}
|
||||
|
||||
//中止冒泡
|
||||
lay.stope = function(e){
|
||||
e = e || window.event;
|
||||
e.stopPropagation
|
||||
? e.stopPropagation()
|
||||
: e.cancelBubble = true;
|
||||
};
|
||||
|
||||
//对象遍历
|
||||
lay.each = function(obj, fn){
|
||||
var key
|
||||
,that = this;
|
||||
if(typeof fn !== 'function') return that;
|
||||
obj = obj || [];
|
||||
if(obj.constructor === Object){
|
||||
for(key in obj){
|
||||
if(fn.call(obj[key], key, obj[key])) break;
|
||||
}
|
||||
} else {
|
||||
for(key = 0; key < obj.length; key++){
|
||||
if(fn.call(obj[key], key, obj[key])) break;
|
||||
}
|
||||
}
|
||||
return that;
|
||||
};
|
||||
|
||||
//数字前置补零
|
||||
lay.digit = function(num, length, end){
|
||||
var str = '';
|
||||
num = String(num);
|
||||
length = length || 2;
|
||||
for(var i = num.length; i < length; i++){
|
||||
str += '0';
|
||||
}
|
||||
return num < Math.pow(10, length) ? str + (num|0) : num;
|
||||
};
|
||||
|
||||
//创建元素
|
||||
lay.elem = function(elemName, attr){
|
||||
var elem = document.createElement(elemName);
|
||||
lay.each(attr || {}, function(key, value){
|
||||
elem.setAttribute(key, value);
|
||||
});
|
||||
return elem;
|
||||
};
|
||||
|
||||
//获取节点的 style 属性值
|
||||
lay.getStyle = function(node, name){
|
||||
var style = node.currentStyle ? node.currentStyle : window.getComputedStyle(node, null);
|
||||
return style[style.getPropertyValue ? 'getPropertyValue' : 'getAttribute'](name);
|
||||
};
|
||||
|
||||
//载入 CSS 依赖
|
||||
lay.link = function(href, fn, cssname){
|
||||
var head = document.getElementsByTagName("head")[0], link = document.createElement('link');
|
||||
if(typeof fn === 'string') cssname = fn;
|
||||
var app = (cssname || href).replace(/\.|\//g, '');
|
||||
var id = 'layuicss-'+ app, timeout = 0;
|
||||
|
||||
link.rel = 'stylesheet';
|
||||
link.href = href;
|
||||
link.id = id;
|
||||
|
||||
if(!document.getElementById(id)){
|
||||
head.appendChild(link);
|
||||
}
|
||||
|
||||
if(typeof fn !== 'function') return;
|
||||
|
||||
//轮询css是否加载完毕
|
||||
(function poll() {
|
||||
if(++timeout > 8 * 1000 / 100){
|
||||
return window.console && console.error(app + '.css: Invalid');
|
||||
};
|
||||
parseInt(lay.getStyle(document.getElementById(id), 'width')) === 1989 ? fn() : setTimeout(poll, 100);
|
||||
}());
|
||||
};
|
||||
|
||||
//当前页面是否存在滚动条
|
||||
lay.hasScrollbar = function(){
|
||||
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight);
|
||||
};
|
||||
|
||||
//元素定位
|
||||
lay.position = function(elem, elemView, obj){
|
||||
if(!elemView) return;
|
||||
obj = obj || {};
|
||||
|
||||
//如果绑定的是 document 或 body 元素,则直接获取鼠标坐标
|
||||
if(elem === document || elem === lay('body')[0]){
|
||||
obj.clickType = 'right';
|
||||
}
|
||||
|
||||
//绑定绑定元素的坐标
|
||||
var rect = obj.clickType === 'right' ? function(){
|
||||
var e = obj.e || window.event || {};
|
||||
return {
|
||||
left: e.clientX
|
||||
,top: e.clientY
|
||||
,right: e.clientX
|
||||
,bottom: e.clientY
|
||||
}
|
||||
}() : elem.getBoundingClientRect()
|
||||
,elemWidth = elemView.offsetWidth //控件的宽度
|
||||
,elemHeight = elemView.offsetHeight //控件的高度
|
||||
|
||||
//滚动条高度
|
||||
,scrollArea = function(type){
|
||||
type = type ? 'scrollLeft' : 'scrollTop';
|
||||
return document.body[type] | document.documentElement[type];
|
||||
}
|
||||
|
||||
//窗口宽高
|
||||
,winArea = function(type){
|
||||
return document.documentElement[type ? 'clientWidth' : 'clientHeight']
|
||||
}, margin = 5, left = rect.left, top = rect.bottom;
|
||||
|
||||
//判断右侧是否超出边界
|
||||
if(left + elemWidth + margin > winArea('width')){
|
||||
left = winArea('width') - elemWidth - margin; //如果超出右侧,则将面板向右靠齐
|
||||
}
|
||||
|
||||
//判断底部和顶部是否超出边界
|
||||
if(top + elemHeight + margin > winArea()){
|
||||
//优先顶部是否有足够区域显示完全
|
||||
if(rect.top > elemHeight + margin){
|
||||
top = rect.top - elemHeight - margin*2; //顶部有足够的区域显示
|
||||
} else {
|
||||
//如果面板是鼠标右键弹出,且顶部没有足够区域显示,则将面板向底部靠齐
|
||||
if(obj.clickType === 'right'){
|
||||
top = winArea() - elemHeight - margin*2;
|
||||
if(top < 0) top = 0; //不能溢出窗口顶部
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//定位类型
|
||||
var position = obj.position;
|
||||
if(position) elemView.style.position = position;
|
||||
|
||||
//设置坐标
|
||||
elemView.style.left = left + (position === 'fixed' ? 0 : scrollArea(1)) + 'px';
|
||||
elemView.style.top = top + (position === 'fixed' ? 0 : scrollArea()) + 'px';
|
||||
|
||||
//防止页面无滚动条时,又因为弹出面板而出现滚动条导致的坐标计算偏差
|
||||
if(!lay.hasScrollbar()){
|
||||
var rect1 = elemView.getBoundingClientRect();
|
||||
//如果弹出面板的溢出窗口底部,则表示将出现滚动条,此时需要重新计算坐标
|
||||
if(!obj.SYSTEM_RELOAD && (rect1.bottom + margin) > winArea()){
|
||||
obj.SYSTEM_RELOAD = true;
|
||||
setTimeout(function(){
|
||||
lay.position(elem, elemView, obj);
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//获取元素上的参数配置上
|
||||
lay.options = function(elem, attr){
|
||||
var othis = lay(elem)
|
||||
,attrName = attr || 'lay-options';
|
||||
try {
|
||||
return new Function('return '+ (othis.attr(attrName) || '{}'))();
|
||||
} catch(ev) {
|
||||
hint.error('parseerror:'+ ev, 'error');
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
//元素是否属于顶级元素(document 或 body)
|
||||
lay.isTopElem = function(elem){
|
||||
var topElems = [document, lay('body')[0]]
|
||||
,matched = false;
|
||||
lay.each(topElems, function(index, item){
|
||||
if(item === elem){
|
||||
return matched = true
|
||||
}
|
||||
});
|
||||
return matched;
|
||||
};
|
||||
|
||||
//追加字符
|
||||
LAY.addStr = function(str, new_str){
|
||||
str = str.replace(/\s+/, ' ');
|
||||
new_str = new_str.replace(/\s+/, ' ').split(' ');
|
||||
lay.each(new_str, function(ii, item){
|
||||
if(!new RegExp('\\b'+ item + '\\b').test(str)){
|
||||
str = str + ' ' + item;
|
||||
}
|
||||
});
|
||||
return str.replace(/^\s|\s$/, '');
|
||||
};
|
||||
|
||||
//移除值
|
||||
LAY.removeStr = function(str, new_str){
|
||||
str = str.replace(/\s+/, ' ');
|
||||
new_str = new_str.replace(/\s+/, ' ').split(' ');
|
||||
lay.each(new_str, function(ii, item){
|
||||
var exp = new RegExp('\\b'+ item + '\\b')
|
||||
if(exp.test(str)){
|
||||
str = str.replace(exp, '');
|
||||
}
|
||||
});
|
||||
return str.replace(/\s+/, ' ').replace(/^\s|\s$/, '');
|
||||
};
|
||||
|
||||
//查找子元素
|
||||
LAY.prototype.find = function(selector){
|
||||
var that = this;
|
||||
var index = 0, arr = []
|
||||
,isObject = typeof selector === 'object';
|
||||
|
||||
this.each(function(i, item){
|
||||
var nativeDOM = isObject ? [selector] : item.querySelectorAll(selector || null);
|
||||
for(; index < nativeDOM.length; index++){
|
||||
arr.push(nativeDOM[index]);
|
||||
}
|
||||
that.shift();
|
||||
});
|
||||
|
||||
if(!isObject){
|
||||
that.selector = (that.selector ? that.selector + ' ' : '') + selector
|
||||
}
|
||||
|
||||
lay.each(arr, function(i, item){
|
||||
that.push(item);
|
||||
});
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
//DOM遍历
|
||||
LAY.prototype.each = function(fn){
|
||||
return lay.each.call(this, this, fn);
|
||||
};
|
||||
|
||||
//添加css类
|
||||
LAY.prototype.addClass = function(className, type){
|
||||
return this.each(function(index, item){
|
||||
item.className = LAY[type ? 'removeStr' : 'addStr'](item.className, className)
|
||||
});
|
||||
};
|
||||
|
||||
//移除 css 类
|
||||
LAY.prototype.removeClass = function(className){
|
||||
return this.addClass(className, true);
|
||||
};
|
||||
|
||||
//是否包含 css 类
|
||||
LAY.prototype.hasClass = function(className){
|
||||
var has = false;
|
||||
this.each(function(index, item){
|
||||
if(new RegExp('\\b'+ className +'\\b').test(item.className)){
|
||||
has = true;
|
||||
}
|
||||
});
|
||||
return has;
|
||||
};
|
||||
|
||||
//添加或获取 css style
|
||||
LAY.prototype.css = function(key, value){
|
||||
var that = this
|
||||
,parseValue = function(v){
|
||||
return isNaN(v) ? v : (v +'px');
|
||||
};
|
||||
return (typeof key === 'string' && value === undefined) ? function(){
|
||||
if(that.length > 0) return that[0].style[key];
|
||||
}() : that.each(function(index, item){
|
||||
typeof key === 'object' ? lay.each(key, function(thisKey, thisValue){
|
||||
item.style[thisKey] = parseValue(thisValue);
|
||||
}) : item.style[key] = parseValue(value);
|
||||
});
|
||||
};
|
||||
|
||||
//添加或获取宽度
|
||||
LAY.prototype.width = function(value){
|
||||
var that = this;
|
||||
return value === undefined ? function(){
|
||||
if(that.length > 0) return that[0].offsetWidth; //此处还需做兼容
|
||||
}() : that.each(function(index, item){
|
||||
that.css('width', value);
|
||||
});
|
||||
};
|
||||
|
||||
//添加或获取高度
|
||||
LAY.prototype.height = function(value){
|
||||
var that = this;
|
||||
return value === undefined ? function(){
|
||||
if(that.length > 0) return that[0].offsetHeight; //此处还需做兼容
|
||||
}() : that.each(function(index, item){
|
||||
that.css('height', value);
|
||||
});
|
||||
};
|
||||
|
||||
//添加或获取属性
|
||||
LAY.prototype.attr = function(key, value){
|
||||
var that = this;
|
||||
return value === undefined ? function(){
|
||||
if(that.length > 0) return that[0].getAttribute(key);
|
||||
}() : that.each(function(index, item){
|
||||
item.setAttribute(key, value);
|
||||
});
|
||||
};
|
||||
|
||||
//移除属性
|
||||
LAY.prototype.removeAttr = function(key){
|
||||
return this.each(function(index, item){
|
||||
item.removeAttribute(key);
|
||||
});
|
||||
};
|
||||
|
||||
//设置HTML内容
|
||||
LAY.prototype.html = function(html){
|
||||
return this.each(function(index, item){
|
||||
item.innerHTML = html;
|
||||
});
|
||||
};
|
||||
|
||||
//设置值
|
||||
LAY.prototype.val = function(value){
|
||||
return this.each(function(index, item){
|
||||
item.value = value;
|
||||
});
|
||||
};
|
||||
|
||||
//追加内容
|
||||
LAY.prototype.append = function(elem){
|
||||
return this.each(function(index, item){
|
||||
typeof elem === 'object'
|
||||
? item.appendChild(elem)
|
||||
: item.innerHTML = item.innerHTML + elem;
|
||||
});
|
||||
};
|
||||
|
||||
//移除内容
|
||||
LAY.prototype.remove = function(elem){
|
||||
return this.each(function(index, item){
|
||||
elem ? item.removeChild(elem) : item.parentNode.removeChild(item);
|
||||
});
|
||||
};
|
||||
|
||||
//事件绑定
|
||||
LAY.prototype.on = function(eventName, fn){
|
||||
return this.each(function(index, item){
|
||||
item.attachEvent ? item.attachEvent('on' + eventName, function(e){
|
||||
e.target = e.srcElement;
|
||||
fn.call(item, e);
|
||||
}) : item.addEventListener(eventName, fn, false);
|
||||
});
|
||||
};
|
||||
|
||||
//解除事件
|
||||
LAY.prototype.off = function(eventName, fn){
|
||||
return this.each(function(index, item){
|
||||
item.detachEvent
|
||||
? item.detachEvent('on'+ eventName, fn)
|
||||
: item.removeEventListener(eventName, fn, false);
|
||||
});
|
||||
};
|
||||
|
||||
//暴露 lay 到全局作用域
|
||||
window.lay = lay;
|
||||
|
||||
//如果在 layui 体系中
|
||||
if(window.layui && layui.define){
|
||||
layui.define(function(exports){ //layui 加载
|
||||
exports(MOD_NAME, lay);
|
||||
});
|
||||
}
|
||||
|
||||
}();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:layui.layedit 富文本编辑器
|
||||
@Author:贤心
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -43,7 +42,7 @@ layui.define(['layer', 'form'], function(exports){
|
||||
return that;
|
||||
};
|
||||
|
||||
//事件监听
|
||||
//事件
|
||||
Edit.prototype.on = function(events, callback){
|
||||
return layui.onevent(MOD_NAME, events, callback);
|
||||
};
|
||||
@@ -423,7 +422,7 @@ layui.define(['layer', 'form'], function(exports){
|
||||
,shadeClose: true
|
||||
,shade: 0.1
|
||||
,skin: 'layui-layer-msg'
|
||||
,content: ['http://www.layui.com/about/layedit/help.html', 'no']
|
||||
,content: ['', 'no']
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:layer v3.2.0 Web弹层组件
|
||||
@Author:贤心
|
||||
@Site:http://layer.layui.com
|
||||
@Name:layer - Web 弹出层组件
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -39,7 +37,7 @@ var isLayui = window.layui && layui.define, $, win, ready = {
|
||||
return style[style.getPropertyValue ? 'getPropertyValue' : 'getAttribute'](name);
|
||||
},
|
||||
|
||||
//载入CSS配件
|
||||
//载入 CSS 依赖
|
||||
link: function(href, fn, cssname){
|
||||
|
||||
//未设置路径,则不主动加载css
|
||||
@@ -72,7 +70,7 @@ var isLayui = window.layui && layui.define, $, win, ready = {
|
||||
|
||||
//默认内置方法。
|
||||
var layer = {
|
||||
v: '3.2.0',
|
||||
v: '3.3.0',
|
||||
ie: function(){ //ie版本
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
return (!!window.ActiveXObject || "ActiveXObject" in window) ? (
|
||||
@@ -175,17 +173,22 @@ var layer = {
|
||||
shade: false,
|
||||
resize: false,
|
||||
fixed: false,
|
||||
maxWidth: 210
|
||||
maxWidth: 260
|
||||
}, options));
|
||||
}
|
||||
};
|
||||
|
||||
var Class = function(setings){
|
||||
var that = this;
|
||||
var that = this, creat = function(){
|
||||
layer.ready(function(){
|
||||
that.creat();
|
||||
});
|
||||
};
|
||||
that.index = ++layer.index;
|
||||
that.config.maxWidth = $(win).width() - 15*2; //初始最大宽度:当前屏幕宽,左右留 15px 边距
|
||||
that.config = $.extend({}, that.config, ready.config, setings);
|
||||
document.body ? that.creat() : setTimeout(function(){
|
||||
that.creat();
|
||||
document.body ? creat() : setTimeout(function(){
|
||||
creat();
|
||||
}, 30);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name : layui.laypage 分页组件
|
||||
@Author:贤心
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name : layui.laytpl 模板引擎
|
||||
@Author:贤心
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -32,7 +31,7 @@ layui.define(function(exports){
|
||||
.replace(/</g, '<').replace(/>/g, '>').replace(/'/g, ''').replace(/"/g, '"');
|
||||
},
|
||||
error: function(e, tplog){
|
||||
var error = 'Laytpl Error:';
|
||||
var error = 'Laytpl Error: ';
|
||||
typeof console === 'object' && console.error(error + e + '\n'+ (tplog || ''));
|
||||
return error + e;
|
||||
}
|
||||
29
src/modules/mobile.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
|
||||
@Name:layui 移动模块入口 | 构建后则为移动模块集合
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
|
||||
if(!layui['layui.mobile']){
|
||||
layui.config({
|
||||
base: layui.cache.dir + 'lay/modules/mobile/'
|
||||
}).extend({
|
||||
'layer-mobile': 'layer-mobile'
|
||||
,'zepto': 'zepto'
|
||||
,'upload-mobile': 'upload-mobile'
|
||||
,'layim-mobile': 'layim-mobile'
|
||||
});
|
||||
}
|
||||
|
||||
layui.define([
|
||||
'layer-mobile'
|
||||
,'zepto'
|
||||
,'layim-mobile'
|
||||
], function(exports){
|
||||
exports('mobile', {
|
||||
layer: layui['layer-mobile'] //弹层
|
||||
,layim: layui['layim-mobile'] //WebIM
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Title: layui.rate 评分评星
|
||||
@Author: star1029
|
||||
@Title: layui.rate 评分评星组件
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -22,7 +21,7 @@ layui.define('jquery',function(exports){
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件监听
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Title: layui.slider 滑块
|
||||
@Author: star1029
|
||||
@Title: layui.slider 滑块组件
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -22,7 +21,7 @@ layui.define('jquery', function(exports){
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件监听
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:layui.table 表格操作
|
||||
@Author:贤心
|
||||
@Name:layui.table 表格操作组件
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -22,7 +21,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
,table = {
|
||||
config: {
|
||||
checkName: 'LAY_CHECKED' //是否选中状态的字段名
|
||||
,indexName: 'LAY_TABLE_INDEX' //下标索引名
|
||||
,indexName: 'LAY_TABLE_INDEX' //初始下标索引名,用于恢复排序
|
||||
} //全局配置项
|
||||
,cache: {} //数据缓存
|
||||
,index: layui.table ? (layui.table.index + 10000) : 0
|
||||
@@ -34,7 +33,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件监听
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
@@ -68,7 +67,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
//获取当前实例配置项
|
||||
,getThisTableConfig = function(id){
|
||||
var config = thisTable.config[id];
|
||||
if(!config) hint.error('The ID option was not found in the table instance');
|
||||
if(!config) hint.error(id ? ('The table instance with ID \''+ id +'\' not found') : 'ID argument required');
|
||||
return config || null;
|
||||
}
|
||||
|
||||
@@ -645,7 +644,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
delete that.haveInit;
|
||||
|
||||
if(options.data && options.data.constructor === Array) delete that.config.data;
|
||||
that.config = $.extend(true, {}, that.config, options);
|
||||
that.config = $.extend({}, that.config, options);
|
||||
|
||||
that.render();
|
||||
};
|
||||
@@ -1476,7 +1475,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
}
|
||||
});
|
||||
|
||||
//数据行中的事件监听返回的公共对象成员
|
||||
//数据行中的事件返回的公共对象成员
|
||||
var commonMember = function(sets){
|
||||
var othis = $(this)
|
||||
,index = othis.parents('tr').eq(0).data('index')
|
||||
@@ -1490,7 +1489,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
tr: tr //行元素
|
||||
,data: table.clearCacheKey(data) //当前行数据
|
||||
,del: function(){ //删除行数据
|
||||
table.cache[that.key][index] = [];
|
||||
table.cache[that.key][index] = [];
|
||||
tr.remove();
|
||||
that.scrollPatch();
|
||||
}
|
||||
@@ -1552,9 +1551,9 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
//重置数据单选属性
|
||||
layui.each(thisData, function(i, item){
|
||||
if(index === i){
|
||||
item.LAY_CHECKED = true;
|
||||
item[options.checkName] = true;
|
||||
} else {
|
||||
delete item.LAY_CHECKED;
|
||||
delete item[options.checkName];
|
||||
}
|
||||
});
|
||||
that.setThisRowChecked(index);
|
||||
@@ -1581,7 +1580,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
setRowEvent.call(this, 'rowDouble');
|
||||
});
|
||||
|
||||
//创建行单击、双击事件监听
|
||||
//创建行单击、双击事件
|
||||
var setRowEvent = function(eventType){
|
||||
var othis = $(this);
|
||||
if(othis.data('off')) return; //不触发事件
|
||||
@@ -1758,7 +1757,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
try{
|
||||
tableData = new Function('return '+ tableData)();
|
||||
} catch(e){
|
||||
hint.error(errorTips + tableData)
|
||||
hint.error(errorTips + tableData, 'error')
|
||||
}
|
||||
|
||||
var cols = [], options = $.extend({
|
||||
@@ -1890,6 +1889,19 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
};
|
||||
};
|
||||
|
||||
//获取表格当前页的所有行数据
|
||||
table.getData = function(id){
|
||||
var arr = []
|
||||
,data = table.cache[id] || [];
|
||||
layui.each(data, function(i, item){
|
||||
if(item.constructor === Array){
|
||||
return;
|
||||
};
|
||||
arr.push(table.clearCacheKey(item));
|
||||
});
|
||||
return arr;
|
||||
};
|
||||
|
||||
//表格导出
|
||||
table.exportFile = function(id, data, type){
|
||||
var that = this;
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:layui.transfer 穿梭框
|
||||
@Author:贤心
|
||||
@Name:layui.transfer 穿梭框组件
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -28,7 +27,7 @@ layui.define(['laytpl', 'form'], function(exports){
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件监听
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
@@ -130,12 +129,7 @@ layui.define(['laytpl', 'form'], function(exports){
|
||||
//重载实例
|
||||
Class.prototype.reload = function(options){
|
||||
var that = this;
|
||||
|
||||
layui.each(options, function(key, item){
|
||||
if(item.constructor === Array) delete that.config[key];
|
||||
});
|
||||
|
||||
that.config = $.extend(true, {}, that.config, options);
|
||||
that.config = $.extend({}, that.config, options);
|
||||
that.render();
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Name:layui.tree 树
|
||||
@Author:star1029
|
||||
@Name:layui.tree 树组件
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -28,7 +27,7 @@ layui.define('form', function(exports){
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件监听
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
|
||||
@Title: layui.upload 文件上传
|
||||
@Author: 贤心
|
||||
@Title: layui.upload 文件上传组件
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
@@ -25,7 +24,7 @@ layui.define('layer' , function(exports){
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件监听
|
||||
//事件
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
@@ -227,11 +226,11 @@ layui.define('layer' , function(exports){
|
||||
allDone();
|
||||
}
|
||||
};
|
||||
//监听进度条
|
||||
//进度条
|
||||
if(typeof options.progress === 'function'){
|
||||
opts.xhr = function(){
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
//监听上传进度
|
||||
//上传进度
|
||||
xhr.upload.addEventListener("progress", function (e) {
|
||||
if(e.lengthComputable) {
|
||||
var percent = Math.floor((e.loaded/e.total)* 100); //百分比
|
||||