Browse Source

修复 layer 弹层容器中的 `id` 值与其他弹层索引值相同时,导致关闭弹层存在冲突问题

pull/1312/head
贤心 1 year ago
parent
commit
2699cc3d45
  1. 6
      src/modules/layer.js

6
src/modules/layer.js

@ -1175,10 +1175,10 @@ layer.title = function(name, index){
// 关闭 layer 总方法 // 关闭 layer 总方法
layer.close = function(index, callback){ layer.close = function(index, callback){
var layero = function(){ var layero = function(){
var closest = $('.'+ doms[0]).find('#'+ index).closest('.'+ doms[0]); var closest = $('.'+ doms[0]).children('#'+ index).closest('.'+ doms[0]);
return closest[0] ? ( return closest[0] ? (
index = closest.attr('times') index = closest.attr('times'),
,closest closest
) : $('#'+ doms[0] + index) ) : $('#'+ doms[0] + index)
}(); }();
var type = layero.attr('type'); var type = layero.attr('type');

Loading…
Cancel
Save