From 85893c77c634083b0b6c8dbed911e0c54092475c Mon Sep 17 00:00:00 2001 From: Victor Shnayder Date: Wed, 3 Oct 2012 09:25:57 -0400 Subject: [PATCH] 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) --- common/lib/xmodule/xmodule/js/src/collapsible.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/collapsible.coffee b/common/lib/xmodule/xmodule/js/src/collapsible.coffee index 6e469d3704..314e7ca868 100644 --- a/common/lib/xmodule/xmodule/js/src/collapsible.coffee +++ b/common/lib/xmodule/xmodule/js/src/collapsible.coffee @@ -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()