Show a confirm box before fancybox
===

I have an app with customers who have tasks. To create a new task for a customer you can click a add icon which opens a fancybox with the new task form displayed. This has the following coffee script:

<!-- language: lang-cs -->

    jQuery ->
      $("a.fancyForm").fancybox
	  scrolling: "no"
	  titleShow: false

However, customers also must have a goal to work towards otherwise the tasks are for nought. So the relationship is really customer has many goals which has many tasks. If the customer already has some goals then the form simply asks you which goal it works towards. If the customer doesn't have a goal then I want to pop up a confirm box that asks if the user would like to make a goal now. This is the coffee script I currently have:

<!-- language: lang-cs -->

    $("a.noGoals").click (e) ->
      e.preventDefault()
      confirm_create_goal = confirm("There is currently no Goal for " + $(this).data("customer") + ". Would you like to create one?")
      if confirm_create_goal
        $("a.noGoals").fancybox()
      else
        alert "You won't be able to create tasks until a goal is created!"

This brings up the confirmation box by click ok appears to do nothing. If you then try a second time it displays the confirmation box and if you click ok or cancel it displays the correct fancybox with my new goal form. How do I get this to work first time round? It seems for the first click of ok it only sets confirm_create_goal and then only opens the fancybox on the second attempt.