Make collapsibles not collapse the entire page

- need to set text of the link, not the document
- there was something funny with the operator precedence in the ternary operator (was getting 'true', instead of a string)
This commit is contained in:
Victor Shnayder
2012-10-03 09:25:57 -04:00
parent f627c9e9c1
commit 85893c77c6

View File

@@ -18,8 +18,11 @@ class @Collapsible
@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)
if $(event.target).text() == 'See full output'
new_text = 'Hide output'
else
new_text = 'See full ouput'
$(event.target).text(new_text)
@toggleHint: (event) =>
event.preventDefault()