Created
September 25, 2014 20:01
-
-
Save lemieux/9470dcf998bfe90d4a45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Public: Show the adder. | |
# | |
# Returns nothing. | |
show: => | |
r = this.selectedSkeleton.ranges[0] | |
normedRange = Range.sniff(r).normalize(this.annotator.element[0]) | |
range = normedRange.toRange() | |
clientRectangle = range.getBoundingClientRect() | |
# Position the Adder close to the text if it was hidden | |
if @element.hasClass('annotator-hide') | |
@element.hide().css({ | |
top: clientRectangle.top + Util.getGlobal().scrollY - 7, | |
left: ( | |
clientRectangle.left + | |
clientRectangle.width / 2 + | |
Util.getGlobal().scrollX | |
) | |
}).show('fast') | |
else | |
@element.animate({ | |
top: clientRectangle.top + Util.getGlobal().scrollY - 7, | |
left: ( | |
clientRectangle.left + | |
clientRectangle.width / 2 + | |
Util.getGlobal().scrollX | |
) | |
}, 200) | |
super |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment