Also clean up children after sort saved.

This commit is contained in:
Don Mitchell
2013-03-20 17:59:24 -04:00
parent bd2dd9408d
commit 3ea70eac9d

View File

@@ -34,7 +34,10 @@ class CMS.Views.UnitEdit extends Backbone.View
@$('.components').sortable(
handle: '.drag-handle'
update: (event, ui) => @model.save(children: @components())
update: (event, ui) =>
payload = children : @components()
options = success : => @model.unset('children')
@model.save(payload, options)
helper: 'clone'
opacity: '0.5'
placeholder: 'component-placeholder'