this.progress = new Roo.bootstrap.Progress({
cls : 'roo-document-manager-progress',
active : true,
- striped : true,
+ striped : true
});
this.progress.render(this.progressDialog.getChildContainer());
renderPreview : function(file)
{
- var _this = this;
-
- var imageEl = document.createElement('img');
-
- var _this = this;
-
- imageEl.addEventListener("load", function(){ _this.drawPreview(imageEl); });
-
- this.imageEl.src = baseURL +'/Images/Thumb/' + this.thumbSize + '/' + file.id + '/' + file.filename;
+ if(typeof(file.target) != 'undefined' && file.target){
+ return file;
+ }
var previewEl = this.managerEl.createChild({
tag : 'div',
{
tag : 'button',
cls : 'close',
- html : 'x'
+ html : '<i class="fa fa-times-circle"></i>'
}
]
});
var image = previewEl.select('img', true).first();
-// image.dom.addEventListener("load", function(){ _this.onPreviewLoad(image); });
+ var _this = this;
+
+ image.dom.addEventListener("load", function(){ _this.onPreviewLoad(file, image); });
image.on('click', this.onClick, this, file);
return file;
+
},
- drawPreview : function(imageEl)
+ onPreviewLoad : function(file, image)
{
- var width = this.imageEl.naturalWidth || this.imageEl.width;
- var height = this.imageEl.naturalHeight || this.imageEl.height;
+ if(typeof(file.target) == 'undefined' || !file.target){
+ return;
+ }
+
+ var width = image.dom.naturalWidth || image.dom.width;
+ var height = image.dom.naturalHeight || image.dom.height;
- Roo.log('on preview load');
- Roo.log(this);
- Roo.log(image.dom.naturalWidth);
+ if(width > height){
+ file.target.addClass('wide');
+ return;
+ }
+
+ file.target.addClass('tall');
+ return;
}
});