         # Setup events for when the rule thumbnails are clicked
         $(@_classRuleThumbBox).click((event)=>@_ruleThumbBoxClicked(event))    
 
+    #
+    # Event handler for when a rule thumbnail is clicked
+    # Sets the rule and switches to the generator
+    # 
     _ruleThumbBoxClicked:(event) ->
 
         jBox = $(event.currentTarget)


class RuleThumbnails

    constructor: (VariablesInstance, TabsInstance)->
        @_Vars = VariablesInstance
        @_Tabs = TabsInstance
        @_idTmplRuleThumbnails = "#tmpl-cagen-rulethumbnails"
        @_classRuleThumbBox = ".cagen-rulethumb-box"

    show: ()->
        # Setup the list of rules
        @_ruleList = [0..255]
        
        thumbnailHTML = $(@_idTmplRuleThumbnails).html()
        rendered = Mustache.render(thumbnailHTML, {ruleList:@_ruleList})
        @_Vars.jMainContainer.html(rendered)

###

Generate the Rule Thumbnails for CAGEN and the event
handler for when a rule thumbnail is clicked.

@author Destin Moulton
@git https://github.com/destinmoulton/cagen
@license MIT

Component of Cellular Automata GENerator (CAGEN)


Each rule has a thumbnail. The user can click the thumbnail
to generate the Automata for that rule.

Tabs instantiates and runs the Rule Thumbnail generation.

