Update admin.js

This commit is contained in:
Anyon 2022-03-28 10:39:49 +08:00
parent f83de1256d
commit 002e49491c

View File

@ -1022,13 +1022,12 @@ $(function () {
}); });
/*! 注册 data-tips-image 事件行为 */ /*! 注册 data-tips-image 事件行为 */
onEvent('click', '[data-tips-image]', function () { onEvent('click', '[data-tips-image]', function (event) {
var items = [], $imgs; (event.items = [], event.$imgs = $(this).parent().find('[data-tips-image]')).map(function () {
($imgs = $(this).parent().find('[data-tips-image]')).map(function () { event.items.push({src: this.dataset.tipsImage || this.dataset.lazySrc || this.src});
items.push({src: this.dataset.tipsImage || this.dataset.lazySrc || this.src});
}) && layui.layer.photos({ }) && layui.layer.photos({
anim: 5, closeBtn: 1, photos: {start: $imgs.index(this), data: items}, tab: function (pic, $ele) { anim: 5, closeBtn: 1, photos: {start: event.$imgs.index(this), data: event.items}, tab: function (pic, $ele) {
$ele.find('.layui-layer-close').css({position: 'fixed', top: 0, right: 0}); $ele.find('.layui-layer-close').css({top: 0, right: 0, position: 'fixed'});
} }
}); });
}); });