Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Fix annotations placement
Browse files Browse the repository at this point in the history
  • Loading branch information
joegatt committed Jul 17, 2013
1 parent e6ef45e commit a4e5bc8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
12 changes: 6 additions & 6 deletions app/assets/javascripts/nembrot.document.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ content_initializers = () ->
document.title = $('hgroup').data('title')

# needs to happen on resize
format_annotations()
place_annotations()

format_annotations = () ->
(if media_query('screen-and-min-width-1024px') then format_annotations_do() else format_annotations_undo())
place_annotations = () ->
(if media_query('screen-and-min-width-1024px') then _place_annotations_do() else _place_annotations_undo())
true

format_annotations_do = () ->
_place_annotations_do = () ->
minimum = 0
new_top = undefined
corrected_top = undefined
Expand All @@ -26,7 +26,7 @@ format_annotations_do = () ->
minimum = new_top + $(this).outerHeight(true)
$(this).offset top: corrected_top

format_annotations_undo = () ->
_place_annotations_undo = () ->
$("li[id*=annotation-]").offset top: 'auto'

media_query = (media_query_string) ->
Expand All @@ -44,4 +44,4 @@ $(document).on 'pjax:end', ->
content_initializers()

$(document).on 'resize', ->
format_annotations()
place_annotations()
17 changes: 9 additions & 8 deletions app/assets/stylesheets/themes/default.css.sass
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
body
&:after
content: $media-query
// line-height: 0
// visibility: hidden
line-height: 0
visibility: hidden

///////////////////////////////
//
Expand Down Expand Up @@ -258,7 +258,7 @@ footer
.annotations
font:
size: $small-font-size + 1px
size: $small-font-size
line-height: $line-height * 2/3
text-align: left
text-indent: 0
Expand Down Expand Up @@ -578,21 +578,22 @@ ol.books
position: absolute
a:first-of-type
color: $headline-font-color
font:
size: $small-font-size
padding-right: 3px
text-align: right
vertical-align: super
width: $text-indent - 3px
a
color: $link-color
+transition
a[id*=annotation-mark]
color: $count-color
// Use single blue line (border) for internal on hover, double for external
// Undo all...
// Make sure this only applies to ltr pages
// Maybe we need to always write dir in body / html
[dir=ltr]
section#note-content[dir=rtl]
#note-content[dir=rtl]
#text
+place(6, 6, 0)
.map_container
Expand Down Expand Up @@ -708,13 +709,13 @@ ol.books

#text
+place(0, 6, 6)
section.annotations
.annotations
+fade(0)
+hyphens
+column(3, 6)
+push(6, 6)
&:hover
section.annotations
.annotations
+fade(1)

footer
Expand Down

0 comments on commit a4e5bc8

Please sign in to comment.