Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sentsim committed Mar 20, 2021
1 parent 6adc9f6 commit 5cccb9f
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 30 deletions.
7 changes: 2 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"name": "layer",
"main": "src/layer.js",
"version": "3.2.0",
"version": "3.3.0",
"homepage": "https://github.com/sentsin/layer",
"authors": [
"sentsin <[email protected]>"
],
"description": "弹窗组件",
"description": "Web 通用弹出层组件",
"moduleType": [
"amd",
"globals"
Expand Down
4 changes: 2 additions & 2 deletions dist/layer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mobile/layer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/theme/default/layer.css

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "layui-layer",
"realname": "layer",
"version": "3.2.0",
"version": "3.3.0",
"mobile": "2.0.0",
"description": "Web 弹层组件",
"description": "Web 通用弹出层组件",
"main": "src/layer.js",
"license": "MIT",
"scripts": {
Expand All @@ -13,7 +13,6 @@
"type": "https",
"url": "git+https://github.com/sentsin/layer.git"
},
"author": "贤心",
"devDependencies": {
"gulp": "^3.9.0",
"gulp-minify-css": "^1.2.4",
Expand Down
26 changes: 15 additions & 11 deletions src/layer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
@Name:layer-v3.2.0 Web 弹层组件
@Author:贤心
@Name:layer - Web 弹出层组件
@License:MIT
*/
Expand Down Expand Up @@ -71,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) ? (
Expand Down Expand Up @@ -174,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);
};

Expand Down Expand Up @@ -286,7 +290,7 @@ Class.pt.creat = function(){
layer.closeAll('dialog');
break;
case 2:
var content = config.content = conType ? config.content : [config.content||'http://layer.layui.com', 'auto'];
var content = config.content = conType ? config.content : [config.content||'', 'auto'];
config.content = '<iframe scrolling="'+ (config.content[1]||'auto') +'" allowtransparency="true" id="'+ doms[4] +''+ times +'" name="'+ doms[4] +''+ times +'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="' + config.content[0] + '"></iframe>';
break;
case 3:
Expand Down Expand Up @@ -981,8 +985,8 @@ layer.prompt = function(options, yes){
style = 'style="width: '+ area[0] +'; height: '+ area[1] + ';"';
delete options.area;
}
var prompt, content = options.formType == 2 ? '<textarea class="layui-layer-input"' + style +'>' + (options.value||'') +'</textarea>' : function(){
return '<input type="'+ (options.formType == 1 ? 'password' : 'text') +'" class="layui-layer-input" value="'+ (options.value||'') +'">';
var prompt, content = options.formType == 2 ? '<textarea class="layui-layer-input"' + style +'></textarea>' : function(){
return '<input type="'+ (options.formType == 1 ? 'password' : 'text') +'" class="layui-layer-input">';
}();

var success = options.success;
Expand All @@ -996,7 +1000,7 @@ layer.prompt = function(options, yes){
,maxWidth: win.width()
,success: function(layero){
prompt = layero.find('.layui-layer-input');
prompt.focus();
prompt.val(options.value || '').focus();
typeof success === 'function' && success(layero);
}
,resize: false
Expand Down
13 changes: 6 additions & 7 deletions src/theme/default/layer.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
@Name: layer
@Author: 贤心
**/

Expand Down Expand Up @@ -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; }
Expand All @@ -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 }
Expand Down Expand Up @@ -129,16 +128,16 @@ 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;}

/* 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;}
Expand Down

0 comments on commit 5cccb9f

Please sign in to comment.