mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-25 19:06:38 +08:00
文件上传,增加删除 change 事件
This commit is contained in:
parent
0a51f6bb78
commit
99046439d4
@ -602,7 +602,7 @@ $(function () {
|
|||||||
$bt.on('click', 'i.layui-icon-search', function (event) {
|
$bt.on('click', 'i.layui-icon-search', function (event) {
|
||||||
event.stopPropagation(), $in.val() && $.form.iframe(encodeURI($in.val()), '视频预览');
|
event.stopPropagation(), $in.val() && $.form.iframe(encodeURI($in.val()), '视频预览');
|
||||||
}).on('click', 'i.layui-icon-close', function (event) {
|
}).on('click', 'i.layui-icon-close', function (event) {
|
||||||
event.stopPropagation(), $bt.attr('style', '').find('span[data-file]').html('') && $in.val('');
|
event.stopPropagation(), $bt.attr('style', '').find('span[data-file]').html('') && $in.val('').trigger('change');
|
||||||
}).find('[data-file]').data('input', this).attr({
|
}).find('[data-file]').data('input', this).attr({
|
||||||
'data-path': $in.data('path') || '', 'data-size': $in.data('size') || 0, 'data-type': $in.data('type') || 'mp4',
|
'data-path': $in.data('path') || '', 'data-size': $in.data('size') || 0, 'data-type': $in.data('type') || 'mp4',
|
||||||
});
|
});
|
||||||
@ -620,7 +620,7 @@ $(function () {
|
|||||||
$bt.on('click', 'i.layui-icon-search', function (event) {
|
$bt.on('click', 'i.layui-icon-search', function (event) {
|
||||||
event.stopPropagation(), $in.val() && $.previewImage(encodeURI($in.val()));
|
event.stopPropagation(), $in.val() && $.previewImage(encodeURI($in.val()));
|
||||||
}).on('click', 'i.layui-icon-close', function (event) {
|
}).on('click', 'i.layui-icon-close', function (event) {
|
||||||
event.stopPropagation(), $bt.attr('style', '') && $in.val('');
|
event.stopPropagation(), $bt.attr('style', '') && $in.val('').trigger('change');
|
||||||
}).find('[data-file]').data('input', this).attr({
|
}).find('[data-file]').data('input', this).attr({
|
||||||
'data-path': $in.data('path') || '', 'data-size': $in.data('size') || 0, 'data-type': $in.data('type') || 'gif,png,jpg,jpeg',
|
'data-path': $in.data('path') || '', 'data-size': $in.data('size') || 0, 'data-type': $in.data('type') || 'gif,png,jpg,jpeg',
|
||||||
'data-max-width': $in.data('max-width') || 0, 'data-max-height': $in.data('max-height') || 0,
|
'data-max-width': $in.data('max-width') || 0, 'data-max-height': $in.data('max-height') || 0,
|
||||||
@ -648,7 +648,8 @@ $(function () {
|
|||||||
$img = $('<div class="uploadimage uploadimagemtl"><div><a class="layui-icon"></a><a class="layui-icon">ဆ</a><a class="layui-icon"></a></div></div>');
|
$img = $('<div class="uploadimage uploadimagemtl"><div><a class="layui-icon"></a><a class="layui-icon">ဆ</a><a class="layui-icon"></a></div></div>');
|
||||||
$img.attr('data-tips-image', encodeURI(src)).css('backgroundImage', 'url(' + encodeURI(src) + ')').on('click', 'a', function (event, index, prevs, $item) {
|
$img.attr('data-tips-image', encodeURI(src)).css('backgroundImage', 'url(' + encodeURI(src) + ')').on('click', 'a', function (event, index, prevs, $item) {
|
||||||
event.stopPropagation(), $item = $(this).parent().parent(), index = $(this).index();
|
event.stopPropagation(), $item = $(this).parent().parent(), index = $(this).index();
|
||||||
if (index === 2 && $item.index() !== $bt.prevAll('div.uploadimage').length) $item.next().after($item); else if (index === 0 && $item.index() > 1) $item.prev().before($item); else if (index === 1) $item.remove();
|
if (index === 2 && $item.index() !== $bt.prevAll('div.uploadimage').length) $item.next().after($item);
|
||||||
|
else if (index === 0 && $item.index() > 1) $item.prev().before($item); else if (index === 1) $item.remove();
|
||||||
ims = [], $bt.prevAll('.uploadimage').map(function () {
|
ims = [], $bt.prevAll('.uploadimage').map(function () {
|
||||||
ims.push($(this).attr('data-tips-image'));
|
ims.push($(this).attr('data-tips-image'));
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user