删除文章后重新赋值msnry对象,解决 删除第一个图文后,列表排成1竖列的bug

This commit is contained in:
陶欣 2020-06-23 16:56:19 +08:00 committed by GitHub
parent a6f0eeb0ed
commit 21f928be21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,6 +58,7 @@
$.form.load('{:url("remove")}', {value: 0, field: 'delete', id: that.getAttribute('data-news-del')}, 'post', function (ret) {
if (ret.code) {
$(that).parents('.news-item').remove();
msnry = new Masonry(item, {itemSelector: '.news-item', columnWidth: 0});
return $.msg.success(ret.msg), msnry.layout(), false;
}
return $.msg.error(ret.msg), false;