zoukankan      html  css  js  c++  java
  • Ueditor——多文件上传重复 顺序错乱

    百度编辑器 Ueditor上传文件是由 webUploader写的  解决问题可以参考下 webUploader的使用 

    百度编辑器UEditor1.4.3以后版本多图上传图片顺序错乱修复

    1,在ueditor/dialogs/image/image.js文件里:

    将原来的  _this.imageList.push(json);  修改为  _this.imageList[$file.index()] = json;

    2, ueditor/dialogs/attachment/attachment.js

    将原来的  _this.fileList.push(json);修改为  _this.fileList[$file.index()] = json;

    官网的修复方法:

    1,在ueditor/dialogs/image/image.js文件里:

    再或者在ueditor/dialogs/image/image.js文件里搜索“var $file = $(‘#’ + file.id);”,在其下面加上如下代码即可:

    // 搜索
    var $file = $('#' + file.id);
    
    

    // 加入
    uploader.stop();
    setTimeout(function () { uploader.upload(); }, 1000);
     

    这里的1000是暂停1秒,也可设为500(半秒),400,,700等

     新增:图片如果重复很可能是上传处理的代码生成文件名字的地方出了错 建议查看处理 生成唯一的图片名字切记

    注重细节——关注底层——注重细节——关注底层——注重细节——关注底层——注重细节——关注底层——注重细节——关注底层
  • 相关阅读:
    类的定义
    面向对象与面向过程介绍
    跨目录导入模块
    正则表达式re模块
    常用工具包(模块)
    生成器generator
    闭包
    命名空间name space
    函数的递归
    POJ1062
  • 原文地址:https://www.cnblogs.com/PJG20/p/13197226.html
Copyright © 2011-2022 走看看