#= require ./behavior

class window.nuclearifyAlertView extends window.Behavior

  init: ->
    @alertForm = $("#alert-form")
    @takeChargeForm = $("#take-charge-form")
    @alertId = @data('alert-id')
    @nuclearifySave($("#save-alert"))
    @nuclearifyTakeCharge($("#take-charge"))

  nuclearifySave: ($dom) ->
    $dom.nuclear
      alertText: $dom.data('confirm-text')
      delay: 0
      onClick: =>
        @alertForm.submit()

  nuclearifyTakeCharge: ($dom) ->
    $dom.nuclear
      alertText: $dom.data('confirm-text')
      delay: 0
      onClick: =>
        @takeChargeForm.submit()
