Roo/dialog/UploadCropbox.js
[roojs1] / Roo / dialog / UploadCropbox.js
index e3b2521..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
@@ -886,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);