From 63841e7fa80bcf43f9f8ff917760ee03b89091af Mon Sep 17 00:00:00 2001 From: Koen Bok Date: Sun, 5 Oct 2014 16:22:41 +0200 Subject: [PATCH] Cleanup --- framer/Layer.coffee | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/framer/Layer.coffee b/framer/Layer.coffee index 9eb13a89d..5d56564b6 100644 --- a/framer/Layer.coffee +++ b/framer/Layer.coffee @@ -405,19 +405,6 @@ class exports.Layer extends BaseClass copySingle: -> new Layer @properties - ############################################################## - ## ANIMATION - - animate: (options) -> - - options.layer = @ - options.curveOptions = options - - animation = new Animation options - animation.start() - - animation - ############################################################## ## IMAGE @@ -660,10 +647,14 @@ class exports.Layer extends BaseClass addListener: (eventName, originalListener) => + # To avoid an error in Framer Studio we return if no originalListener was given + if not originalListener + return + # # Modify the scope to be the calling object, just like jquery # # also add the object as the last argument listener = (args...) => - originalListener.call @, args..., @ + originalListener.call(@, args..., @) # Because we modify the listener we need to keep track of it # so we can find it back when we want to unlisten again