Browse Source

无JIRA任务 多文件上传相关

master
windy 4 years ago
parent
commit
f39535420c
  1. 1
      changelog.md
  2. 4
      src/base/single/editor/editor.multifile.js
  3. 11
      src/base/single/input/file.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志
2.0(2020-12)
- 文件上传控件新增API(setMaxFileLength)以动态设置最大上传文件数量
- Pane系列提供small和big两种大小的加载动画
- 同步树列表系列支持不显示节点连接线和展开收起图标
- 规范了下拉树trigger中显示值的显示顺序

4
src/base/single/editor/editor.multifile.js

@ -71,6 +71,10 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
this.file.reset();
},
setMaxFileLength: function (v) {
this.file.setMaxFileLength(v);
},
select: function () {
this.file.select();
},

11
src/base/single/input/file.js

@ -545,12 +545,12 @@
},
_events: function (wrap) {
var self = this;
var self = this, o = this.options;
event.add(wrap.dom.input, "change", function () {
event.del(wrap.dom.input, "change", arguments.callee);
var input = wrap.dom.input.cloneNode(true);
var files = F(wrap.dom.input);
if (wrap.maxLength !== -1 && wrap.maxLength < files.length) {
if (o.maxLength !== -1 && o.maxLength < files.length) {
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 2
});
@ -654,6 +654,13 @@
});
},
setMaxFileLength: function(v) {
this.options.maxLength = v;
if (this.wrap) {
this.wrap.maxLength = v;
}
},
select: function () {
this.wrap && BI.Widget._renderEngine.createElement(this.wrap.dom.input).click();
},

Loading…
Cancel
Save