Skip to content

Instantly share code, notes, and snippets.

View standuprey's full-sized avatar

Stan Duprey standuprey

View GitHub Profile
@standuprey
standuprey / cropme touch
Created May 18, 2014 23:16
cropme with touch event, unfortunately works only for left and right
angular.module("cropme", ["ngSanitize", "ngTouch"]).directive "cropme", ($swipe, $window, $timeout, $rootScope) ->
minHeight = 100 # if destinationHeight has not been defined, we need a default height for the crop zone
borderSensitivity = 8 # grab area size around the borders in pixels
checkScopeVariables = (scope) ->
if scope.destinationHeight
if scope.ratio
throw "You can't specify both destinationHeight and ratio, destinationHeight = destinationWidth * ratio"
else