diff --git a/public/static/admin.js b/public/static/admin.js index 69e2ce244..6a91b707e 100644 --- a/public/static/admin.js +++ b/public/static/admin.js @@ -573,9 +573,13 @@ $(function () { $.fn.uploadOneImage = function () { return this.each(function () { if ($(this).data('inited')) return true; else $(this).data('inited', true); - var $in = $(this), $bt = $('').data('input', this); - $bt.attr('data-size', $in.data('size') || 0).attr('data-type', $in.data('type') || 'png,jpg,gif').find('span').on('click', function (event) { - event.stopPropagation(), $bt.attr('style', ''), $in.val(''); + var $in = $(this), $bt = $('').data('input', this); + $bt.attr('data-size', $in.data('size') || 0).attr('data-type', $in.data('type') || 'png,jpg,gif').find('span').on('click', function (event, index) { + index = $(this).index(); + event.stopPropagation(); + if (index === 0) $bt.attr('style', ''), $in.val(''); + else if($in.val()) $.previewImage(encodeURI($in.val())); + }), $in.on('change', function () { if (this.value) $bt.css('backgroundImage', 'url(' + encodeURI(this.value) + ')'); }).after($bt).trigger('change'); diff --git a/public/static/theme/css/_custom.less b/public/static/theme/css/_custom.less index 03c456de3..803e48a37 100644 --- a/public/static/theme/css/_custom.less +++ b/public/static/theme/css/_custom.less @@ -4,7 +4,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: http://demo.thinkadmin.top // +---------------------------------------------------------------------- @@ -628,9 +628,7 @@ box-shadow: @ShadowMinOuter; background: url('../img/upimg.png') no-repeat center center; background-size: cover; - - span.layui-icon { - right: 0; + span.layui-icon{ color: #fff; width: 20px; height: 20px; @@ -640,6 +638,14 @@ line-height: 22px; background: rgba(0, 0, 0, .5) } + + span.layui-icon:first-child { + left: 0; + } + + span.layui-icon:last-child { + right: 0; + } &:hover span.layui-icon { display: inline-block;