   #
   # params - Object representing serialised data from options form.
   ns.initStudy = (params) ->
-    $('#study .js-hide-on-load').hide()
-    $('#study .js-loading').show()
+    ns.startLoading()
 
     #Flip the card.
     $('.js-hide-back').click (e) ->

        kksystem.cardsets.study.setCardText
          front: @use_card.front
          back: @use_card.back
        kksystem.cardsets.study.stopLoading()
      else
        current_box.done = true
        ns.displayNextCard()
    else
      kksystem.cardsets.study.finishStudy()

namespace 'kksystem.cardsets.study.single_box', (ns) ->
  ns.init = (params) ->

    $('#study .js-front .js-card-text').text(config.front)
    $('#study .js-back .js-card-text').text(config.back)

  # Public: Prepares the correct and incorrect buttons in the study view.
  #
  # correct_callback - Called when correct button is clicked.
  # incorrect_callback - Called when incorrect button is clicked.
  ns.hookupCorrectnessButtons = (correct_callback, incorrect_callback) ->
    $('#correct').unbind('click').click (e) ->
      correct_callback()
      e.preventDefault()
      return false
    $('#incorrect').unbind('click').click (e) ->
      incorrect_callback()
      e.preventDefault()
      return false

  # Public: Starts showing loading status indicators and hides the ready view.
  ns.startLoading = ->
    $('#study .js-hide-on-load').hide()
    $('#study .js-loading').show()

  # Public: Stops showing loading status indicators and shows the ready view.
  ns.stopLoading = ->
    $('#study .js-loading').hide()
