diff --git a/app/admin/view/api/upload.js b/app/admin/view/api/upload.js index dde3a1147..215c54b42 100644 --- a/app/admin/view/api/upload.js +++ b/app/admin/view/api/upload.js @@ -188,7 +188,7 @@ define(['md5', 'notify'], function (SparkMD5, Notify, allowMime) { $(this.option.elem.data('input')).val(file.xurl).trigger('change', file); } // 文件上传成功事件 - this.event('choose', file.xurl).event('upload.done', {file: file, data: ret}, file, message); + this.event('push', file.xurl).event('upload.done', {file: file, data: ret}, file, message); /*! 所有文件上传完成后结果处理 */ if (this.count.success + this.count.error >= this.count.total) { this.option.hide || $.msg.close(this.loader); diff --git a/app/admin/view/api/upload/image.html b/app/admin/view/api/upload/image.html index 0bea8c68c..aacce5539 100644 --- a/app/admin/view/api/upload/image.html +++ b/app/admin/view/api/upload/image.html @@ -75,7 +75,7 @@ }, // 设置选择数据 setValue: function (url) { - this.$btn.triggerHandler('choose', url); + this.$btn.triggerHandler('push', url); if (this.$btn.data('input')) $(this.$btn.data('input')).val(url).trigger('change', url); $('#ImageDialog').parents('.layui-layer-content').next().find('.layui-layer-close').trigger('click'); }, diff --git a/public/static/admin.js b/public/static/admin.js index fed4cea45..b7fcfed81 100644 --- a/public/static/admin.js +++ b/public/static/admin.js @@ -611,7 +611,7 @@ $(function () { if ($(this).data('inited')) return true; else $(this).data('inited', true); var $bt = $('
'); var ims = this.value ? this.value.split('|') : [], $in = $(this).after($bt); - $bt.find('[data-file]').attr('data-size', $in.data('size') || 0).attr('data-type', $in.data('type') || 'gif,png,jpg,jpeg').data('input', this).on('choose', function (evt, src) { + $bt.find('[data-file]').attr('data-size', $in.data('size') || 0).attr('data-type', $in.data('type') || 'gif,png,jpg,jpeg').data('input', this).on('done', function (evt, src) { ims.push(src), $in.val(ims.join('|')), showImageContainer([src]); }) && (ims.length > 0 && showImageContainer(ims)) diff --git a/public/static/plugs/ckeditor4/config.js b/public/static/plugs/ckeditor4/config.js index 5329c0173..2df3e7c11 100644 --- a/public/static/plugs/ckeditor4/config.js +++ b/public/static/plugs/ckeditor4/config.js @@ -25,7 +25,7 @@ CKEDITOR.plugins.add("uimage", { editor.ui.addButton("UploadImage", {label: "上传本地图片", command: 'uimage', icon: 'image', toolbar: 'insert,10'}); setTimeout(function () { $('#cke_' + editor.name).find('.cke_button__uploadimage_label').parent().map(function () { - $(this).attr('data-type', 'png,jpg,gif,jpeg').attr('data-file', 'mul').uploadFile(function (url) { + $(this).attr('data-type', 'png,jpg,gif,jpeg').attr('data-file', 'images').on('push', function (e, url) { editor.insertElement(CKEDITOR.dom.element.createFromHtml('
')); }); });