 
     @delete_button.click =>
       @parent.trigger 'deleteCategory', this
+
+    @node.on "updateProperties", (event) =>
+      @properties = _.sortBy @properties, (property) ->
+        property.node.find(".js-position").val()
 
   name: ->
     @node.find(".js-cat-name").val()

    { key: @key(), value: @value() }

$('table.js-category-table').ready ->
  td_count = $(@).find('tbody tr:first-child').first().children().length
  $('table.js-category-table tbody').sortable
    handle: '.handle',
    helper: (event, ui) ->
      ui.children().each ->
        $(@).width($(@).width())
      return ui
    placeholder: 'ui-sortable-placeholder',
    start: (event, ui) ->
      ui.placeholder.height(ui.item.height())

    @properties = []

    categoryEditorTemplate = _.template($("#category-editor-template").html())
    @node = $("<div class='js-category-node'></div>").html(categoryEditorTemplate(category_editor: this))
    @parent.append @node

    @delete_button = @node.find '.js-delete-category'
