Permalink
Browse files

updateSpecialFields

  • Loading branch information...
1 parent c80a0d3 commit 06016124422821847c443460e231767ec8fba4e0 @jsmarkus committed Nov 29, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 ItemView.coffee
View
@@ -13,6 +13,7 @@ module.exports = ({backbone, knockout})->
if @model then @unsubscribeFromModel @model
@model = model
@subscribeToModel @model
+ @updateVmSpecialFields @model
@afterSubscribeToModel?()
subscribeToModel : (model)->
@@ -28,6 +29,9 @@ module.exports = ({backbone, knockout})->
updateVm : (model, fieldValues)->
for field in @fields when fieldValues.hasOwnProperty field
@vm[field] fieldValues[field]
+ @updateVmSpecialFields model
+
+ updateVmSpecialFields : (model)->
@vm.$isNew model.isNew()
onVmChange : (field, value)=>

0 comments on commit 0601612

Please sign in to comment.