   constructor: (@node, payload, @product_id) ->
     @category_editors = []
 
-    this.fetchCategories(payload)
+    @fetchCategories(payload)
 
     @node.on 'click', '.add-category', =>
-      this.addCategory({name: 'New Category'})
+      @addCategory({name: 'New Category'})
 
     @node.on 'click', '.save', =>
-      this.save()
+      @save()
 
     @node.on 'deleteCategory', (ev, category) =>
-      this.categoryDeleted(category)
+      @categoryDeleted(category)
 
   categoryDeleted: (category) ->
     category.node.remove()


  serialize: ->
    {
      name: this.name(),
      properties: @properties.map (p) -> p.serialize()
    }



    if @category.properties
      $.each @category.properties, (index, item) =>
        @addProperty(item)

    @property_rows.on 'deleteProperty', (ev, property) =>
      @propertyDeleted(property)

    @add_property_button.click =>
      @addProperty({key: '', value: ''})

    @delete_button.click =>
      @parent.trigger 'deleteCategory', this
