File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 759759 } ) ( ) ;
760760
761761 angular . module ( 'ImageCropper' , [ ] )
762- . directive ( 'imageCrop' , function ( ) {
762+ . directive ( 'imageCrop' , function ( $q ) {
763763
764764 return {
765765 template : '<div id="image-crop-{{ rand }}" class="ng-image-crop ng-image-crop--{{ shape }}" ng-style="moduleStyles"><section ng-style="sectionStyles" ng-show="step==1"></section><section ng-style="sectionStyles" ng-show="step==2"><canvas class="cropping-canvas" width="{{ canvasWidth }}" height="{{ canvasHeight }}" ng-mousemove="onCanvasMouseMove($event)" ng-mousedown="onCanvasMouseDown($event)"></canvas><div ng-style="croppingGuideStyles" class="cropping-guide"></div><div class="zoom-handle" ng-mousemove="onHandleMouseMove($event)" ng-mousedown="onHandleMouseDown($event)" ng-mouseup="onHandleMouseUp($event)"><span>← zoom →</span></div></section><section ng-style="sectionStyles" class="image-crop-section-final" ng-show="step==3"><img class="image-crop-final" ng-src="{{ croppedDataUri }}" /></section></div>' ,
806806 var maxZoomGestureLength = 0 ;
807807 var maxZoomedInLevel = 0 , maxZoomedOutLevel = 2 ;
808808 var minXPos = 0 , maxXPos = ( padding / 2 ) , minYPos = 0 , maxYPos = ( padding / 2 ) ; // for dragging bounds
809- var maxSize = scope . maxSize ? Number ( scope . maxSize ) : null ; //max size of the image in px
809+ var maxSize = scope . maxSize ? Number ( scope . maxSize ) : null ; //max size of the image in px
810810
811811 var zoomWeight = .6 ;
812812 var ctx = $canvas . getContext ( '2d' ) ;
833833
834834 function handleSize ( base64ImageSrc ) {
835835
836- return new Promise ( function ( resolve , reject ) {
836+ return $q ( function ( resolve , reject ) {
837837
838838 if ( ! maxSize ) {
839839 return resolve ( base64ImageSrc ) ;
889889
890890 function handleEXIF ( base64ImageSrc , exif ) {
891891
892- return new Promise ( function ( resolve , reject ) {
892+ return $q ( function ( resolve , reject ) {
893893
894894 var img = new Image ( ) ;
895895 img . src = base64ImageSrc ;
13411341 } ) ;
13421342
13431343
1344- } ) ( ) ;
1344+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments