X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=docs%2Fsymbols%2Fsrc%2FRoo_bootstrap_DocumentManager.js.html;h=19db19f173bc137a4d96e25018ad27e1358c23bc;hp=de8666f892351f2e6b9573bae66396999a284d73;hb=8d86e89a287e97d762b8a33fff3dbab8d868c1fc;hpb=d0f3fdb1f9192739ee4016b6ede7dfb9c27b15d7
diff --git a/docs/symbols/src/Roo_bootstrap_DocumentManager.js.html b/docs/symbols/src/Roo_bootstrap_DocumentManager.js.html
index de8666f892..19db19f173 100644
--- a/docs/symbols/src/Roo_bootstrap_DocumentManager.js.html
+++ b/docs/symbols/src/Roo_bootstrap_DocumentManager.js.html
@@ -10,10 +10,8 @@
* @cfg {String} paramName default 'imageUpload'
* @cfg {String} method default POST
* @cfg {String} url action url
- * @cfg {Number} boxes number of boxes default 12
+ * @cfg {Number} boxes number of boxes, 0 is no limit.. default 0
* @cfg {Boolean} multiple multiple upload default true
- * @cfg {Number} minWidth default 300
- * @cfg {Number} minHeight default 300
* @cfg {Number} thumbSize default 300
* @cfg {String} fieldLabel
* @cfg {Number} labelWidth default 4
@@ -95,10 +93,8 @@
Roo.extend(Roo.bootstrap.DocumentManager, Roo.bootstrap.Component, {
- boxes : 12,
+ boxes : 0,
inputName : '',
- minWidth : 300,
- minHeight : 300,
thumbSize : 300,
multiple : true,
files : [],
@@ -296,13 +292,13 @@
return;
}
- if(this.files.length > this.boxes){
+ if(this.boxes > 0 && this.files.length > this.boxes){
this.files = this.files.slice(0, this.boxes);
}
this.uploader.show();
- if(this.files.length > this.boxes - 1){
+ if(this.boxes > 0 && this.files.length > this.boxes - 1){
this.uploader.hide();
}
@@ -310,6 +306,8 @@
var files = [];
+ var docs = [];
+
Roo.each(this.files, function(file){
if(typeof(file.id) != 'undefined' && file.id * 1 > 0){
@@ -318,7 +316,17 @@
return;
}
- this.delegates.push(
+ if(file.type.indexOf('image') != -1){
+ this.delegates.push(
+ (function(){
+ _this.process(file);
+ }).createDelegate(this)
+ );
+
+ return;
+ }
+
+ docs.push(
(function(){
_this.process(file);
}).createDelegate(this)
@@ -328,6 +336,8 @@
this.files = files;
+ this.delegates = this.delegates.concat(docs);
+
if(!this.delegates.length){
this.refresh();
return;
@@ -363,7 +373,7 @@
{
this.uploader.show();
- if(this.files.length > this.boxes - 1){
+ if(this.boxes > 0 && this.files.length > this.boxes - 1){
this.uploader.hide();
}
@@ -399,6 +409,22 @@
this.refresh();
},
+ clear : function()
+ {
+ Roo.each(this.files, function(file){
+ if(!file.target){
+ return;
+ }
+
+ file.target.remove();
+
+ }, this);
+
+ this.files = [];
+
+ this.refresh();
+ },
+
onClick : function(e, el, o)
{
e.preventDefault();