Roo/dialog/UploadCropbox.js
[roojs1] / Roo / dialog / UploadCropbox.js
index adf63de..d2da9d5 100644 (file)
          * @param {Object} file
          */
         "inspect" : true,
+        /**
+         * @event beforeupload
+         * Fire before xhr upload the file
+         * @param {Roo.dialog.UploadCropbox} this
+         * @param {Object} data
+         */
+         "upload" : true,
         /**
          * @event upload
          * Fire when xhr upload the file
@@ -150,6 +157,7 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
     cropData : false,
     minWidth : 300,
     minHeight : 300,
+    outputMaxWidth : 1200,
     file : false,
     exif : {},
     baseRotate : 1,
@@ -885,8 +893,8 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
                 sx = sx < 0 ? 0 : (sx / this.getScaleLevel());
                 sy = sy < 0 ? 0 : (sy / this.getScaleLevel());
 
-                if(canvas.width > 1200) {
-                    var scale = 1200 / canvas.width;
+                if(canvas.width > this.outputMaxWidth) {
+                    var scale = this.outputMaxWidth / canvas.width;
                     canvas.width = canvas.width * scale;
                     canvas.height = canvas.height * scale;
                     context.scale(scale, scale);