Permalink
Browse files

Add experimental OmitNew

So you can omit the new keyword for *Layer, Frame and Animation.
  • Loading branch information...
koenbok committed Aug 19, 2014
1 parent bccd4e3 commit 605920240fcb6e96f10337036862648a27e9fdfc
Showing with 17 additions and 1 deletion.
  1. +2 −1 framer/Extras/Extras.coffee
  2. +15 −0 framer/Extras/OmitNew.coffee
@@ -1,2 +1,3 @@
# exports.Hints = require "./Hints"
exports.MobileScrollFix = require "./MobileScrollFix"
exports.MobileScrollFix = require "./MobileScrollFix"
exports.OmitNew = require "./OmitNew"
@@ -0,0 +1,15 @@
exports.enable = (module=window) ->
ClassWrapper = (Klass)->
CreateWrapper = (args...) ->
if @ is window
return new Klass args...
else
@prototype = new Klass args...
return CreateWrapper
module.Frame = ClassWrapper(Framer.Frame)
module.Layer = ClassWrapper(Framer.Layer)
module.BackgroundLayer = ClassWrapper(Framer.BackgroundLayer)
module.VideoLayer = ClassWrapper(Framer.VideoLayer)
module.Animation = ClassWrapper(Framer.Animation)

0 comments on commit 6059202

Please sign in to comment.