pull/54/head
sentsin 2016-11-07 15:45:04 +08:00
parent f6d55f6c12
commit dfeded7f0d
2 changed files with 24 additions and 18 deletions

File diff suppressed because one or more lines are too long

View File

@ -527,12 +527,13 @@ Class.pt.move = function(){
//拖拽移动 //拖拽移动
if(dict.moveStart){ if(dict.moveStart){
var X = e.clientX - dict.offset[0] var X = e.clientX - dict.offset[0]
,Y = e.clientY - dict.offset[1]; ,Y = e.clientY - dict.offset[1]
,fixed = layero.css('position') === 'fixed';
e.preventDefault(); e.preventDefault();
dict.stX = config.fixed ? 0 : win.scrollLeft(); dict.stX = fixed ? 0 : win.scrollLeft();
dict.stY = config.fixed ? 0 : win.scrollTop(); dict.stY = fixed ? 0 : win.scrollTop();
//控制元素不被拖出窗口外 //控制元素不被拖出窗口外
if(!config.moveOut){ if(!config.moveOut){
@ -740,24 +741,27 @@ layer.iframeSrc = function(index, url){
}; };
//设定层的样式 //设定层的样式
layer.style = function(index, options){ layer.style = function(index, options, limit){
var layero = $('#'+ doms[0] + index) var layero = $('#'+ doms[0] + index)
,contElem = layero.find('.layui-layer-content') ,contElem = layero.find('.layui-layer-content')
,type = layero.attr('type') ,type = layero.attr('type')
,titHeight = layero.find(doms[1]).outerHeight() || 0 ,titHeight = layero.find(doms[1]).outerHeight() || 0
,btnHeight = layero.find('.'+doms[6]).outerHeight() || 0; ,btnHeight = layero.find('.'+doms[6]).outerHeight() || 0
,minLeft = layero.attr('minLeft');
if(type === ready.type[3] || type === ready.type[4]){ if(type === ready.type[3] || type === ready.type[4]){
return; return;
} }
if(parseFloat(options.width) <= 260){ if(!limit){
options.width = 260; if(parseFloat(options.width) <= 260){
}; options.width = 260;
};
if(parseFloat(options.height) - titHeight - btnHeight <= 64){
options.height = 64 + titHeight + btnHeight; if(parseFloat(options.height) - titHeight - btnHeight <= 64){
}; options.height = 64 + titHeight + btnHeight;
};
}
layero.css(options); layero.css(options);
if(type === ready.type[2]){ if(type === ready.type[2]){
@ -775,9 +779,11 @@ layer.style = function(index, options){
//最小化 //最小化
layer.min = function(index, options){ layer.min = function(index, options){
var layero = $('#'+ doms[0] + index); var layero = $('#'+ doms[0] + index)
var titHeight = layero.find(doms[1]).outerHeight() || 0; ,titHeight = layero.find(doms[1]).outerHeight() || 0
var left = layero.attr('minLeft') || (261*ready.minIndex)+'px'; ,left = layero.attr('minLeft') || (181*ready.minIndex)+'px'
,position = layero.css('position');
ready.record(layero); ready.record(layero);
if(ready.minLeft[0]){ if(ready.minLeft[0]){
@ -785,7 +791,7 @@ layer.min = function(index, options){
ready.minLeft.shift(); ready.minLeft.shift();
} }
layero.attr('position', layero.css('position')); layero.attr('position', position);
layer.style(index, { layer.style(index, {
width: 180 width: 180
@ -794,7 +800,7 @@ layer.min = function(index, options){
,top: win.height() - titHeight ,top: win.height() - titHeight
,position: 'fixed' ,position: 'fixed'
,overflow: 'hidden' ,overflow: 'hidden'
}); }, true);
layero.find('.layui-layer-min').hide(); layero.find('.layui-layer-min').hide();
layero.attr('type') === 'page' && layero.find(doms[4]).hide(); layero.attr('type') === 'page' && layero.find(doms[4]).hide();