Call super in constructor to assign PaneModel properties

The theorist model superclass constructor will automatically assign
all declared properties, or substitute the specified default value if
no param key is present for that property.
This commit is contained in:
Nathan Sobo
2014-01-08 11:20:15 -07:00
parent ee9b78afb6
commit 2acde6a727

View File

@@ -8,10 +8,11 @@ class PaneModel extends Model
Serializable.includeInto(this)
@properties
items: -> []
activeItem: null
constructor: ({@items, @activeItem}) ->
@items ?= []
constructor: ->
super
@activeItem ?= @items[0]
serializeParams: ->