 class HatTrickWizard
   constructor: (formElem, @wizard) ->
     @form = $(formElem)
-    this.stepShownCallback() # because we just showed the first step (or the one in the URL)
+    this.enableFormwizard()
 
   formwizardEnabled: false
 

    @form.append """<fieldset id="_ht_fake_last_step" style="display: none;" class="step"></fieldset>"""

  enableFormwizard: ->
    @form.formwizard
      formPluginEnabled: true,
      validationEnabled: false,
      focusFirstInput: true,
      historyEnabled: true,
      disableUIStyles: true,
      inDuration: 0,
      next: "button:submit",

  stepsNeedUpdate: false

  stepShownCallback: ->
    currentStepId = this.currentStepId()
    if hatTrick.stepMetadata[currentStepId]?
      hatTrick.metadata.currentStep = hatTrick.stepMetadata[currentStepId]
