From 8d9ecb5de29a91d0fa71c889516ec557508616fd Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Sat, 29 Sep 2007 14:30:24 +0000 Subject: disable right click --- htdocs/cropper/cropper.js | 6 ++++-- htdocs/cropper/cropper.uncompressed.js | 10 ++++++---- htdocs/cropper/lib/dragdrop.js | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'htdocs') diff --git a/htdocs/cropper/cropper.js b/htdocs/cropper/cropper.js index 486a92a..0e4ba7b 100644 --- a/htdocs/cropper/cropper.js +++ b/htdocs/cropper/cropper.js @@ -457,13 +457,15 @@ this.startCoords=this.cloneCoords(this.areaCoords); this.resizing=true; this.resizeHandle=Event.element(e).classNames().toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,""); Event.stop(e); -},startDrag:function(e){ +},startDrag:function(e){ +if(Event.isLeftClick(e)){ this.selArea.show(); this.clickCoords=this.getCurPos(e); this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y},false,false,null); this.dragging=true; this.onDrag(e); -Event.stop(e); +Event.stop(e); +} },getCurPos:function(e){ var el=this.imgWrap,wrapOffsets=Position.cumulativeOffset(el); while(el.nodeName!="BODY"){ diff --git a/htdocs/cropper/cropper.uncompressed.js b/htdocs/cropper/cropper.uncompressed.js index 6618554..78081f7 100644 --- a/htdocs/cropper/cropper.uncompressed.js +++ b/htdocs/cropper/cropper.uncompressed.js @@ -1081,14 +1081,16 @@ Cropper.Img.prototype = { * @return void */ startDrag: function( e ) { + if(Event.isLeftClick(e)){ this.selArea.show(); this.clickCoords = this.getCurPos( e ); - this.setAreaCoords( { x1: this.clickCoords.x, y1: this.clickCoords.y, x2: this.clickCoords.x, y2: this.clickCoords.y }, false, false, null ); + this.setAreaCoords( { x1: this.clickCoords.x, y1: this.clickCoords.y, x2: this.clickCoords.x, y2: this.clickCoords.y }, false, false, null ); - this.dragging = true; - this.onDrag( e ); // incase the user just clicks once after already making a selection - Event.stop( e ); + this.dragging = true; + this.onDrag( e ); // incase the user just clicks once after already making a selection + Event.stop( e ); + } }, /** diff --git a/htdocs/cropper/lib/dragdrop.js b/htdocs/cropper/lib/dragdrop.js index be2a30f..2fc409d 100644 --- a/htdocs/cropper/lib/dragdrop.js +++ b/htdocs/cropper/lib/dragdrop.js @@ -912,4 +912,4 @@ Element.offsetSize = function (element, type) { return element.offsetHeight; else return element.offsetWidth; -} \ No newline at end of file +} -- cgit v1.2.3-24-g4f1b