From: leon Date: Tue, 5 Jul 2022 06:44:00 +0000 (+0800) Subject: roojs-core.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=1479b470b01d360688da1459ac7f064a057a1552 roojs-core.js roojs-core-debug.js roojs-ui.js roojs-ui-debug.js roojs-all.js roojs-debug.js --- diff --git a/roojs-all.js b/roojs-all.js index 8e251a46c1..d7db531008 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -2897,16 +2897,16 @@ this.setCanvasPosition();}},onFooterButtonClick:function(e,el,o,A){switch(A){cas break;case 'download':this.download(e);break;default:break;}this.fireEvent('footerbuttonclick',this,A);},beforeSelectFile:function(e){e.preventDefault();if(this.fireEvent('beforeselectfile',this)!=false){this.selectorEl.dom.click();}},onFileSelected:function(e){e.preventDefault(); if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;}var A=this.selectorEl.dom.files[0];if(this.fireEvent('inspect',this,A)!=false){this.prepare(A);}},trash:function(e){this.fireEvent('trash',this);},download:function(e){this.fireEvent('download',this); },loadCanvas:function(A){if(this.fireEvent('beforeloadcanvas',this,A)!=false){this.reset();this.imageEl=document.createElement('img');var B=this;this.imageEl.addEventListener("load",function(){B.onLoadCanvas();});this.imageEl.src=A;}},onLoadCanvas:function(){this.imageEl.OriginWidth=this.imageEl.naturalWidth||this.imageEl.width; -this.imageEl.OriginHeight=this.imageEl.naturalHeight||this.imageEl.height;if(this.imageEl.OriginWidthE)?C:E); -F=(BF)?D:F);this.previewEl.setLeft(E);this.previewEl.setTop(F);this.mouseX=Roo.isTouch?e.browserEvent.touches[0].pageX:e.getPageX();this.mouseY=Roo.isTouch?e.browserEvent.touches[0].pageY:e.getPageY();},onMouseUp:function(e){e.stopEvent();this.dragable=false; -},onMouseWheel:function(e){e.stopEvent();this.startScale=this.scale;console.log("START SCALE: "+this.scale);this.scale=(e.getWheelDelta()==1)?(this.scale+1):(this.scale-1);console.log("END SCALE: "+this.scale);if(!this.zoomable()){this.scale=this.startScale; -return;}this.draw();return;},zoomable:function(){console.log("THUMBEL");console.log(this.thumbEl);var A=this.thumbEl.getWidth()/this.minWidth;if(this.minWidththis.minWidth/this.minHeight&&this.imageEl.OriginHeightE)?C:E);F=(BF)?D:F);this.previewEl.setLeft(E);this.previewEl.setTop(F);this.mouseX=Roo.isTouch?e.browserEvent.touches[0].pageX:e.getPageX(); +this.mouseY=Roo.isTouch?e.browserEvent.touches[0].pageY:e.getPageY();},onMouseUp:function(e){e.stopEvent();this.dragable=false;},onMouseWheel:function(e){e.stopEvent();this.startScale=this.scale;console.log("START SCALE: "+this.scale);this.scale=(e.getWheelDelta()==1)?(this.scale+1):(this.scale-1); +console.log("END SCALE: "+this.scale);if(!this.zoomable()){this.scale=this.startScale;return;}this.draw();return;},zoomable:function(){console.log("THUMBEL");console.log(this.thumbEl);var A=this.thumbEl.getWidth()/this.minWidth;if(this.minWidththis.minWidth/this.minHeight&&this.imageEl.OriginHeightthis.imageEl.OriginWidth||C>this.imageEl.OriginHeight||(Bthis.imageEl.OriginWidth||C>this.imageEl.OriginHeight||(BD||C>E)){return false; diff --git a/roojs-debug.js b/roojs-debug.js index 0d2341d85a..b5ed3a05be 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -68493,13 +68493,19 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component, { this.imageEl.OriginWidth = this.imageEl.naturalWidth || this.imageEl.width; this.imageEl.OriginHeight = this.imageEl.naturalHeight || this.imageEl.height; + var _this = this; + if(this.imageEl.OriginWidth < this.minWidth) { + Roo.Msg.show({ title: 'Error', msg: "Image width should be at least 720", buttons: {ok : true}, fn: function(res) { - console.log(this); + if(res == 'ok'){ + console.log("OK"); + _this.selectorEl.dom.click(); + } } }); } diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 3760efa4ca..e916938002 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -44001,13 +44001,19 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component, { this.imageEl.OriginWidth = this.imageEl.naturalWidth || this.imageEl.width; this.imageEl.OriginHeight = this.imageEl.naturalHeight || this.imageEl.height; + var _this = this; + if(this.imageEl.OriginWidth < this.minWidth) { + Roo.Msg.show({ title: 'Error', msg: "Image width should be at least 720", buttons: {ok : true}, fn: function(res) { - console.log(this); + if(res == 'ok'){ + console.log("OK"); + _this.selectorEl.dom.click(); + } } }); } diff --git a/roojs-ui.js b/roojs-ui.js index 87640a59df..53edbcf074 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1951,16 +1951,16 @@ this.setCanvasPosition();}},onFooterButtonClick:function(e,el,o,A){switch(A){cas break;case 'download':this.download(e);break;default:break;}this.fireEvent('footerbuttonclick',this,A);},beforeSelectFile:function(e){e.preventDefault();if(this.fireEvent('beforeselectfile',this)!=false){this.selectorEl.dom.click();}},onFileSelected:function(e){e.preventDefault(); if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;}var A=this.selectorEl.dom.files[0];if(this.fireEvent('inspect',this,A)!=false){this.prepare(A);}},trash:function(e){this.fireEvent('trash',this);},download:function(e){this.fireEvent('download',this); },loadCanvas:function(A){if(this.fireEvent('beforeloadcanvas',this,A)!=false){this.reset();this.imageEl=document.createElement('img');var B=this;this.imageEl.addEventListener("load",function(){B.onLoadCanvas();});this.imageEl.src=A;}},onLoadCanvas:function(){this.imageEl.OriginWidth=this.imageEl.naturalWidth||this.imageEl.width; -this.imageEl.OriginHeight=this.imageEl.naturalHeight||this.imageEl.height;if(this.imageEl.OriginWidthE)?C:E); -F=(BF)?D:F);this.previewEl.setLeft(E);this.previewEl.setTop(F);this.mouseX=Roo.isTouch?e.browserEvent.touches[0].pageX:e.getPageX();this.mouseY=Roo.isTouch?e.browserEvent.touches[0].pageY:e.getPageY();},onMouseUp:function(e){e.stopEvent();this.dragable=false; -},onMouseWheel:function(e){e.stopEvent();this.startScale=this.scale;console.log("START SCALE: "+this.scale);this.scale=(e.getWheelDelta()==1)?(this.scale+1):(this.scale-1);console.log("END SCALE: "+this.scale);if(!this.zoomable()){this.scale=this.startScale; -return;}this.draw();return;},zoomable:function(){console.log("THUMBEL");console.log(this.thumbEl);var A=this.thumbEl.getWidth()/this.minWidth;if(this.minWidththis.minWidth/this.minHeight&&this.imageEl.OriginHeightE)?C:E);F=(BF)?D:F);this.previewEl.setLeft(E);this.previewEl.setTop(F);this.mouseX=Roo.isTouch?e.browserEvent.touches[0].pageX:e.getPageX(); +this.mouseY=Roo.isTouch?e.browserEvent.touches[0].pageY:e.getPageY();},onMouseUp:function(e){e.stopEvent();this.dragable=false;},onMouseWheel:function(e){e.stopEvent();this.startScale=this.scale;console.log("START SCALE: "+this.scale);this.scale=(e.getWheelDelta()==1)?(this.scale+1):(this.scale-1); +console.log("END SCALE: "+this.scale);if(!this.zoomable()){this.scale=this.startScale;return;}this.draw();return;},zoomable:function(){console.log("THUMBEL");console.log(this.thumbEl);var A=this.thumbEl.getWidth()/this.minWidth;if(this.minWidththis.minWidth/this.minHeight&&this.imageEl.OriginHeightthis.imageEl.OriginWidth||C>this.imageEl.OriginHeight||(Bthis.imageEl.OriginWidth||C>this.imageEl.OriginHeight||(BD||C>E)){return false;