       @parent.trigger 'deleteProperty', this
 
   key: ->
-    @node.find(".js-key").val()
+    @node.find('.js-key').val()
 
   value: ->
-    @node.find(".js-val").val()
+    @node.find('.js-val').val()
 
   serialize: ->
     { key: @key(), value: @value() }


class ProductPropertyEditor
  constructor: (@category_editor, @parent, @property) ->
    propertyEditorTemplate = _.template($("#property-editor-template").html())
    @node = $("<tr>").html(propertyEditorTemplate(property_editor: this))
    @parent.append @node

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

    $.ajax
      type: 'POST'
      dataType: 'json'
      url: '/api/property_categories'
      headers: 'x-spree-token': Spree.api_key
      data: payload

      success: (data) =>
        show_flash('success', data.flash)
      error: (data) =>
        if data.flash
          show_flash('error', data.flash)
        else
          show_flash('error', 'There was an error updating your properties.')

  serialize: ->
    @category_editors.map (c) -> c.serialize()
