changeset 1720:9723a5ab27d6

fight coffeescript on how to get ctor called Ignore-this: b74e7e5547fb234716862e5dfa4e2885
author Drew Perttula <drewp@bigasterisk.com>
date Mon, 07 May 2018 00:38:33 +0000
parents 165df402cb98
children b4633fb9bccf
files light9/web/timeline/adjustable.coffee
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/light9/web/timeline/adjustable.coffee	Sun May 06 22:41:36 2018 +0000
+++ b/light9/web/timeline/adjustable.coffee	Mon May 07 00:38:33 2018 +0000
@@ -11,6 +11,9 @@
   # into stuff or to get out from under your finger.
 
   constructor: (@config) ->
+    @ctor2()
+
+  ctor2: () ->
     # config has:
     #   getTarget -> vec2 of current target position
     #   getSuggestedTargetOffset -> vec2 pixel offset from target
@@ -75,7 +78,8 @@
     #   observable -> ko.observable we will read and write
     #   getValueForPos(pos) -> what should we set to if the user
     #                          moves target to this coord?
-    super(@config)
+    super()
+    @ctor2()
 
   _getValue: () ->
     @config.observable()
@@ -102,8 +106,8 @@
     #   ctx
     #   getTargetPosForValue(value) -> getTarget result for value
     #   getValueForPos
-
-    super(@config)
+    super()
+    @ctor2()
     if not @config.ctx?
       throw new Error("missing ctx")
     @config.graph.runHandler(@_syncValue.bind(@), "adj sync #{@config.subj}")
@@ -136,12 +140,13 @@
                               
 class window.AdjustableFade extends Adjustable
   constructor: (@yForV, @i0, @i1, @note, offset, ctx) ->
+    super()
     @config = {
       getSuggestedTargetOffset: -> offset
       getTarget: @getTarget.bind(@)
       ctx: ctx
     }
-    super(@config)
+    @ctor2()
 
   getTarget: ->
     mid = @note.worldPts[@i0].x(.5).add(@note.worldPts[@i1].x(.5))