Files
mozo-backend/app/assets/javascripts/supplier/app/mixins/rotation.js.coffee
T
2015-08-17 15:13:31 +02:00

10 lines
311 B
CoffeeScript

App.Rotation = Ember.Mixin.create
rotateLeft: ->
new_rotation = -90 + @get('rotation')
new_rotation += 360 if new_rotation < 0
@set 'rotation', new_rotation
rotateRight: ->
new_rotation = 90 + @get('rotation')
new_rotation -= 360 if new_rotation >= 360
@set 'rotation', new_rotation