Roo/dialog/UploadCropbox.js
[roojs1] / Roo / dialog / UploadCropbox.js
index 97994d7..8279efb 100644 (file)
@@ -558,8 +558,11 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
         e.stopEvent();
         
         this.startScale = this.scale;
-        this.scale = (e.getWheelDelta() == 1) ? (this.scale + 1) : (this.scale - 1);
+        this.scale = (e.getWheelDelta() > 0) ? (this.scale + 1) : (this.scale - 1);
         
+        console.log('startScale: ' + this.startScale);
+        console.log('scale: ' + this.scale);
+        console.log('getWheelDelta: ' + e.getWheelDelta());
         if(!this.zoomable()){
             this.scale = this.startScale;
             return;
@@ -1053,11 +1056,11 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
             }
         }
         
-        height = 300;
+        height = 500;
         width = Math.ceil(this.minWidth * height / this.minHeight);
         
         if(this.minWidth > this.minHeight){
-            width = 300;
+            width = 500;
             height = Math.ceil(this.minHeight * width / this.minWidth);
         }
         
@@ -1308,8 +1311,6 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
 
         formData.append('returnHTML', 'NO');
 
-        console.log("cropType: " + this.cropType);
-
         if(crop){
             formData.append('crop', crop);
             var blobBin = atob(crop.split(',')[1]);
@@ -1391,12 +1392,7 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
         }
         
         this.file = file;
-        if(typeof(file.type) != 'undefined') {
-            console.log("CROPTYPE");
-            console.log(this.cropType);
-            console.log("FILETYPE");
-            console.log(typeof(file.type));
-            console.log(this.cropType);
+        if(typeof(file.type) != 'undefined' && file.type.length != 0) {
             this.cropType = file.type;
         }