记得上下班打卡 | git大法好,push需谨慎

Commit 47dce523 authored by sangchunxi's avatar sangchunxi

限制

parent 8db1b012
......@@ -491,13 +491,19 @@
// 删除list item
function removeListItem (index) {
console.log('removeListItem', index)
let evryGroup = $('#addClassify2').find($('.addAvatarItem'))
console.log(evryGroup.length, index)
if (evryGroup.length <= 1) {
layer.msg('至少保留一个')
} else {
$(`#addClassify2 .addAvatarItem:eq(${index})`).parent().remove()
$.modal.loading("请稍等...");
setTimeout(function () {
$.modal.closeLoading();
}, 500)
}
}
......
......@@ -493,7 +493,7 @@
</div>
</div>
<div><a href="#" class="pull-right btn btn-xs btn-white" style="margin-top: 5px;background: none;border: none;"><i class="fa fa-navicon"></i></a></div>
<div style="position: relative;"><i class="fa fa-remove" onclick="removeListItem(${dynamicDomLength})" style="margin-top: 8px; position: absolute; left: 10px;"></i></div>
<div style="position: relative;"><i class="fa fa-remove" onclick="removeListItem(${dynamicDomLength + 1})" style="margin-top: 8px; position: absolute; left: 10px;"></i></div>
</li>`
......@@ -525,13 +525,17 @@
// 删除list item
function removeListItem (index) {
console.log('removeListItem', index)
let evryGroup = $('#addClassify2').find($('.addAvatarItem'))
if (evryGroup.length <= 1) {
layer.msg('至少保留一个')
} else {
$(`#addClassify2 .addAvatarItem:eq(${index})`).parent().remove()
$.modal.loading("请稍等...");
setTimeout(function () {
$.modal.closeLoading();
}, 500)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment