0dc2fa3f by Michael Richards

Add some code documentation for the Rivets.View class.

1 parent f093f839
...@@ -30,10 +30,14 @@ class Rivets.Binding ...@@ -30,10 +30,14 @@ class Rivets.Binding
30 @el.addEventListener 'change', (el) => 30 @el.addEventListener 'change', (el) =>
31 Rivets.config.adapter.publish @context, @keypath, getInputValue el 31 Rivets.config.adapter.publish @context, @keypath, getInputValue el
32 32
33 # Parses and stores the binding data for an entire view binding.
33 class Rivets.View 34 class Rivets.View
35 # Takes the parent DOM element as well as all the context objects that are to
36 # be binded to the view.
34 constructor: (@el, @contexts) -> 37 constructor: (@el, @contexts) ->
35 @build() 38 @build()
36 39
40 # Parses and builds new Rivets.Binding instances for the data bindings.
37 build: => 41 build: =>
38 @bindings = [] 42 @bindings = []
39 43
...@@ -46,6 +50,7 @@ class Rivets.View ...@@ -46,6 +50,7 @@ class Rivets.View
46 keypath = path.join '.' 50 keypath = path.join '.'
47 @bindings.push new Rivets.Binding node, type, context, keypath 51 @bindings.push new Rivets.Binding node, type, context, keypath
48 52
53 # Binds all of the current bindings for this view.
49 bind: => 54 bind: =>
50 binding.bind() for binding in @bindings 55 binding.bind() for binding in @bindings
51 56
......