layer 弹出层 确定按钮节流
This commit is contained in:
parent
2458e523ba
commit
096ee2fc96
24503
dist/layui.js
vendored
Normal file
24503
dist/layui.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -205,6 +205,7 @@ var Class = function(setings){
|
||||
var that = this, creat = function(){
|
||||
that.creat();
|
||||
};
|
||||
that.yesStatus = true
|
||||
that.index = ++layer.index;
|
||||
that.config.maxWidth = $(win).width() - 15*2; //初始最大宽度:当前屏幕宽,左右留 15px 边距
|
||||
that.config = $.extend({}, that.config, ready.config, setings);
|
||||
@ -683,11 +684,21 @@ Class.pt.callback = function(){
|
||||
}
|
||||
}
|
||||
layer.ie == 6 && that.IE6(layero);
|
||||
// 节流函数
|
||||
|
||||
//按钮
|
||||
// 按钮的事件在这里
|
||||
layero.find('.'+ doms[6]).children('a').on('click', function(){
|
||||
var index = $(this).index();
|
||||
if(index === 0){
|
||||
if(that.yesStatus){
|
||||
that.yesStatus = false
|
||||
setTimeout(()=>{
|
||||
that.yesStatus = true
|
||||
},1000)
|
||||
}else{
|
||||
return
|
||||
}
|
||||
if(config.yes){
|
||||
config.yes(that.index, layero)
|
||||
} else if(config['btn1']){
|
||||
|
Loading…
Reference in New Issue
Block a user