Commit 721dac5d by Tom Giannattasio

added html collapsible

parent be12ef2d
class @HTMLModule
constructor: (@element) ->
@el = $(@element)
@setCollapsibles()
$: (selector) ->
$(selector, @el)
setCollapsibles: =>
$('.longform').hide();
$('.shortform').append('<a href="#" class="full">See full output</a>');
$('.collapsible section').hide();
$('.full').click @toggleFull
$('.collapsible header a').click @toggleHint
toggleFull: (event) =>
$(event.target).parent().siblings().slideToggle()
$(event.target).parent().parent().toggleClass('open')
text = $(event.target).text() == 'See full output' ? 'Hide output' : 'See full output'
$(this).text(text)
toggleHint: (event) =>
event.preventDefault()
$(event.target).parent().siblings().slideToggle()
$(event.target).parent().parent().toggleClass('open')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment