         Session.set "#{tableName}-field-sort-order-#{fieldName}", tableOptions.sortOrder[fieldName].get()
         Session.set "#{tableName}-field-sort-direction-#{fieldName}", tableOptions.sortDirection[fieldName].get()
 
+  ###
+  # tableFields - creates the fields array to pass to the ReactiveTable within
+  # settings. Field criterial is added to the fields array of the tableOptions object on
+  # the template instance
+  #
+  # @param {object} instance, instance of template containing table
+  # @return {array} fields, array containing fields for ReactiveTable
+  ###
   tableFields: (instance) ->
     tableOptions = instance.tableOptions
     fields = []

      fields.push(tableField)
    fields

  gotoEvent: (event, instance) ->
    route = instance.tableOptions.name.slice(0, -1)
    if event.metaKey

    else
      Router.go route, _id: @_id

  ###
  # scrollToTop - scrolls document to top of window
  ###
  scrollToTop: ->
    if window.scrollY > 0 and window.innerHeight < 700
      $(document.body).animate({scrollTop: 0}, 400)
