From 0c70d201f8217e053886af8e2a55108c84bca7da Mon Sep 17 00:00:00 2001 From: Arthur Barrett Date: Tue, 12 Feb 2013 13:57:28 -0500 Subject: [PATCH] Auto-expand the discussion thread after it is scrolled to by simulating a click on the show/hide button. Note: the jQuery highlight effect doesnt work here due to a CSS !important setting on .discussion-module background color. --- .../lib/xmodule/xmodule/js/src/annotatable/display.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee b/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee index 493d8c7110..deaabaf738 100644 --- a/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee @@ -105,8 +105,12 @@ class @Annotatable onAfter: @makeAfterScroll(el) }) - makeAfterScroll: (el, duration = 500) -> - @_once -> el.effect 'shake', {}, duration + makeAfterScroll: (el, duration = 1500) -> + @_once -> + btn = $('.discussion-show', el) + if !btn.hasClass('shown') + btn.click() + #el.effect 'highlight', {}, duration makeTipContent: (el) -> (api) =>