{
xtype : 'UploadCropbox',
xns : Roo.dialog,
- minWidth : 60,
- minHeight: 40,
+ minWidth : 720,
+ minHeight: 480,
+ buttons: [],
listeners : {
- arrange : function (_self, formData)
- {
- console.log("ARRANGE");
- console.log(formData);
- },
- crop : function (_self, data)
- {
- console.log("CROP");
- console.log(data);
- },
- resize : function (_self)
- {
- console.log("RESIZE");
- },
- rotate : function (_self)
- {
- console.log("ROTATE");
- },
render : function (_self)
{
- console.log("RENDER");
- console.log(_self);
_this.cropbox = _self;
+ },
+ loadcanvas : function (_self, imageEl)
+ {
+ // if(imageEl.OriginWidth < 720) {
+ // Roo.Msg.show({
+ // title: 'Error',
+ // msg: "Image width should be at least 720",
+ // buttons: {ok : true},
+ // fn: function(res) {
+ // _this.cropbox.selectorEl.dom.click();
+ // }
+ // });
+ // return false;
+ // }
}
}
}
]
}
],
+ buttons : [
+ {
+ xtype : 'Button',
+ xns : Roo,
+ text : 'Save',
+ listeners : {
+ click : function () {
+ }
+ }
+ },
+ {
+ xtype : 'Button',
+ xns : Roo,
+ text : 'Cancel',
+ listeners : {
+ click : function () {
+ _this.dialog.hide()
+ }
+ }
+ }
+ ]
});
}
}
listeners : {
click : function () {
uploadCropbox.show();
- console.log(uploadCropbox);
+ document.body.onfocus = function(e) {
+ document.body.onfocus = null;
+ if(!uploadCropbox.cropbox.selectorEl.dom.files.length) {
+ uploadCropbox.dialog.hide();
+ }
+ }
+ uploadCropbox.cropbox.selectorEl.dom.click();
}
}
}