Commit 24f519e3 by Arthur Barrett

Moved the return link above the inline discussion and updated the header styling…

Moved the return link above the inline discussion and updated the header styling so the hide annotations button is right-aligned with the help icon.
parent 2848df82
...@@ -11,7 +11,21 @@ ...@@ -11,7 +11,21 @@
padding: 2px 4px; padding: 2px 4px;
border: 1px solid $border-color; border: 1px solid $border-color;
border-radius: 3px; border-radius: 3px;
.annotatable-toggle { } .annotatable-toggle {
position: absolute;
top: 0;
right: 30px;
}
.annotatable-help-icon {
display: block;
position: absolute;
top: 0;
right: 0;
width: 17px;
height: 17px;
background: url(../images/info-icon.png) no-repeat;
}
.annotatable-toggle, .annotatable-help-icon { margin: 2px 7px 2px 0; }
} }
} }
...@@ -46,17 +60,6 @@ ...@@ -46,17 +60,6 @@
} }
} }
.annotatable-help-icon {
display: block;
position: absolute;
right: 0;
top: 33%;
width: 17px;
height: 17px;
margin: 0 7px 0 0;
background: url(../images/info-icon.png) no-repeat;
}
.ui-tooltip.qtip.ui-tooltip { .ui-tooltip.qtip.ui-tooltip {
font-size: $body-font-size; font-size: $body-font-size;
border: 1px solid #333; border: 1px solid #333;
......
...@@ -47,7 +47,7 @@ class @Annotatable ...@@ -47,7 +47,7 @@ class @Annotatable
initDiscussionReturnLinks: () -> initDiscussionReturnLinks: () ->
$(@discussionXModuleSelector).find(@discussionSelector).each (index, el) => $(@discussionXModuleSelector).find(@discussionSelector).each (index, el) =>
$(el).after @createReturnLink(@getDiscussionId el) $(el).before @createReturnLink(@getDiscussionId el)
getTipOptions: (el) -> getTipOptions: (el) ->
content: content:
...@@ -80,14 +80,22 @@ class @Annotatable ...@@ -80,14 +80,22 @@ class @Annotatable
onClickReply: (e) => onClickReply: (e) =>
e.preventDefault() e.preventDefault()
discussion_el = @getInlineDiscussion e.currentTarget discussion_el = @getInlineDiscussion e.currentTarget
return_el = discussion_el.prev(@returnSelector)
if return_el.length == 1
@scrollTo(return_el, () -> @afterScrollToDiscussion(discussion_el))
else
@scrollTo(discussion_el, @afterScrollToDiscussion) @scrollTo(discussion_el, @afterScrollToDiscussion)
onClickReturn: (e) => onClickReturn: (e) =>
e.preventDefault() e.preventDefault()
span_el = @getSpan e.currentTarget
el = @getSpan e.currentTarget
offset = -200 offset = -200
@scrollTo(span_el, @afterScrollToSpan, offset)
@scrollTo(el, @afterScrollToSpan, offset)
getSpan: (el) -> getSpan: (el) ->
discussion_id = @getDiscussionId(el) discussion_id = @getDiscussionId(el)
...@@ -125,14 +133,15 @@ class @Annotatable ...@@ -125,14 +133,15 @@ class @Annotatable
duration: 500 duration: 500
onAfter: @_once => after?.call this, el onAfter: @_once => after?.call this, el
offset: offset offset: offset
}) }) if el
afterScrollToDiscussion: (el) -> afterScrollToDiscussion: (discussion_el) ->
btn = $('.discussion-show', el) btn = $('.discussion-show', discussion_el)
console.log(btn)
btn.click() if !btn.hasClass('shown') btn.click() if !btn.hasClass('shown')
afterScrollToSpan: (el) -> afterScrollToSpan: (span_el) ->
el.effect 'highlight', {color: 'rgba(0,0,0,0.5)' }, 1000 span_el.effect 'highlight', {color: 'rgba(0,0,0,0.5)' }, 1000
makeTipContent: (el) -> makeTipContent: (el) ->
(api) => (api) =>
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
<div class="annotatable-title">${display_name} </div> <div class="annotatable-title">${display_name} </div>
% endif % endif
<div class="annotatable-description"> <div class="annotatable-description">
<div class="annotatable-help-icon" title="Move your cursor over the highlighted areas to display annotations. Discuss the annotations in the forums using the link at the bottom of the annotation. You may hide annotations at any time by using the button at the top of the section."></div> Annotated Reading + Guided Discussion
Annotated Reading + Guided Discussion<br/>
<a href="javascript:void(0)" class="annotatable-toggle">Hide Annotations</a> <a href="javascript:void(0)" class="annotatable-toggle">Hide Annotations</a>
<div class="annotatable-help-icon" title="Move your cursor over the highlighted areas to display annotations. Discuss the annotations in the forums using the link at the bottom of the annotation. You may hide annotations at any time by using the button at the top of the section."></div>
</div> </div>
</div> </div>
......
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