mirror of https://github.com/layui/layer
3.0.2
parent
70cb6982f8
commit
20e28a7aa9
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -1,15 +1,18 @@
|
|||
|
||||
|
||||
# v3.0.2 2017.02.25
|
||||
|
||||
# v3.0.1 2016.12.16
|
||||
* 新增 resizing 回调,用于监听窗口的调整大小
|
||||
* 增加自动ready处理机制,即如果你页面一打开就执行弹层,无需放入layer.ready中
|
||||
* 对moveEnd回调返回一个参数为当前容器的DOM对象
|
||||
* 添加一个amd条件,避免 define出错(Merge pull request #42 from wangyateng/master)
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
# 【v3.0】 2016.11.07
|
||||
# v3.0 2016.11.07
|
||||
|
||||
* 新增拖动弹层右下角可调节弹层尺寸的功能,由参数resize控制,默认开启。对loading、tips层无效
|
||||
* offset参数新增 t、r、b、l、lt、lb、rt、rb、的赋值,可快捷实现上、右、下、左、左上角、左下角、右上角、右下角的边缘定位
|
||||
* 新增btnAlign参数,支持三个参数:l/c/r,分别用于控制按钮居左、居中、居右的快捷设置(默认r,即居右)
|
||||
|
@ -41,7 +44,8 @@
|
|||
---
|
||||
|
||||
|
||||
# 【v2.4】2016.07.03
|
||||
# v2.4 2016.07.03
|
||||
|
||||
* 兼容jQuery3.0
|
||||
* 优化tips,可支持配置参数fix(之前是强制fix: false),用于决定是固定的tips还是非固定的。
|
||||
* min回调可通过return false来设定不执行默认最小化。
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "layer",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.2",
|
||||
"mobile": "2.0.0",
|
||||
"description": "Web弹层组件",
|
||||
"main": "src/layer.js",
|
||||
|
|
24
src/layer.js
24
src/layer.js
|
@ -1,9 +1,9 @@
|
|||
/**
|
||||
|
||||
@Name:layer v3.0.1 Web弹层组件
|
||||
@Name:layer v3.0.2 Web弹层组件
|
||||
@Author:贤心
|
||||
@Site:http://layer.layui.com
|
||||
@License:LGPL
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
|
@ -26,7 +26,7 @@ var isLayui = window.layui && layui.define, $, win, ready = {
|
|||
|
||||
//默认内置方法。
|
||||
var layer = {
|
||||
v: '3.0.1',
|
||||
v: '3.0.2',
|
||||
ie: function(){ //ie版本
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
return (!!window.ActiveXObject || "ActiveXObject" in window) ? (
|
||||
|
@ -83,7 +83,7 @@ var layer = {
|
|||
},
|
||||
|
||||
ready: function(callback){
|
||||
var cssname = 'skinlayercss', ver = '1110';
|
||||
var cssname = 'skinlayercss', ver = '302';
|
||||
isLayui ? layui.addcss('modules/layer/default/layer.css?v='+layer.v+ver, callback, cssname)
|
||||
: layer.link('skin/default/layer.css?v='+layer.v+ver, callback, cssname);
|
||||
return this;
|
||||
|
@ -167,9 +167,11 @@ var Class = function(setings){
|
|||
var that = this;
|
||||
that.index = ++layer.index;
|
||||
that.config = $.extend({}, that.config, ready.config, setings);
|
||||
document.body ? that.creat() : setTimeout(function(){
|
||||
that.creat();
|
||||
}, 50);
|
||||
layer.ready(function(){
|
||||
document.body ? that.creat() : setTimeout(function(){
|
||||
that.creat();
|
||||
}, 50);
|
||||
});
|
||||
};
|
||||
|
||||
Class.pt = Class.prototype;
|
||||
|
@ -248,7 +250,7 @@ Class.pt.creat = function(){
|
|||
,conType = typeof content === 'object'
|
||||
,body = $('body');
|
||||
|
||||
if($('#'+config.id)[0]) return;
|
||||
if(config.id && $('#'+config.id)[0]) return;
|
||||
|
||||
if(typeof config.area === 'string'){
|
||||
config.area = config.area === 'auto' ? ['', ''] : [config.area, ''];
|
||||
|
@ -565,12 +567,13 @@ Class.pt.move = function(){
|
|||
,height: dict.area[1] + Y
|
||||
})
|
||||
dict.isResize = true;
|
||||
config.resizing && config.resizing(layero);
|
||||
}
|
||||
}).on('mouseup', function(e){
|
||||
if(dict.moveStart){
|
||||
delete dict.moveStart;
|
||||
ready.moveElem.hide();
|
||||
config.moveEnd && config.moveEnd();
|
||||
config.moveEnd && config.moveEnd(layero);
|
||||
}
|
||||
if(dict.resizeStart){
|
||||
delete dict.resizeStart;
|
||||
|
@ -895,8 +898,7 @@ layer.close = function(index){
|
|||
|
||||
$('#layui-layer-moves, #layui-layer-shade' + index).remove();
|
||||
layer.ie == 6 && ready.reselect();
|
||||
ready.rescollbar(index);
|
||||
|
||||
ready.rescollbar(index);
|
||||
if(layero.attr('minLeft')){
|
||||
ready.minIndex--;
|
||||
ready.minLeft.push(layero.attr('minLeft'));
|
||||
|
|
|
@ -72,7 +72,7 @@ html #layuicss-skinlayercss{display: none; position: absolute; width: 1989px;}
|
|||
.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px;}
|
||||
.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px;}
|
||||
.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px;}
|
||||
.layui-layer-setwin .layui-layer-close1{background-position:0 -40px; cursor:pointer;}
|
||||
.layui-layer-setwin .layui-layer-close1{background-position: 1px -40px; cursor: pointer;}
|
||||
.layui-layer-setwin .layui-layer-close1:hover{opacity:0.7;}
|
||||
.layui-layer-setwin .layui-layer-close2{position:absolute; right:-28px; top:-28px; width:30px; height:30px; margin-left:0; background-position:-149px -31px; *right:-18px; _display:none;}
|
||||
.layui-layer-setwin .layui-layer-close2:hover{ background-position:-180px -31px;}
|
||||
|
|
Loading…
Reference in New Issue