             color  : "#ffffff"
             diameter : 16
           style    : "modal-clean-gray"
-          callback : callback
+          callback : ->
+            deleteModal.destroy()
+            callback()
  
   viewAppended: JView::viewAppended
 

      title    : "-"
      callback : =>
        @confirmDelete =>

  confirmDelete:(callback) ->

    @deleteModal = new KDModalView
      title        : "Warning"
      content      : "<div class='modalformline'>Are you sure you want to delete this item?</div>"
      height       : "auto"

    @setClass "payment-settings-view"
    group = @getData()
    
    @addName = new KDInputView
      cssClass   : "product-title"
      placeholder: "Product name"
      
    @addPrice = new KDInputView
      cssClass   : "product-price"
      placeholder: "0.00"

    @addButton = new KDButtonView
      cssClass   : "product-button"
      title      : "+"
      callback   : =>
        group.addProduct
          name  : __utils.slugify @addName.getValue()
          price : @addPrice.getValue()
          title : @addName.getValue()
        , (err,plan)=>
          if err
            new KDNotificationView
              title: "Unable to create plan: #{err}"
          else
            @addName.setValue ""
            @addPrice.setValue ""
            @controller.loadItems()

    @controller = new GroupProductListController
      group     : group
      itemClass : GroupProductListItem
    @controller.loadItems()        

    @list = @controller.getListView()
    @list.on "DeleteItem", (code)=>
      group.deleteProduct {code}, =>
        @controller.loadItems()

    @reloadButton = new KDButtonView
      cssClass   : "product-button"
      title      : "R"
      callback   : =>
        @controller.loadItems()

  pistachio:->
    """
    {{> this.addButton}}
    {{> this.addName}}
    {{> this.addPrice}}
    <br>
    {{> this.reloadButton}}
    <br>
    {{> this.controller.getView()}}
    """
