Commit caa20b7a authored by Nick Stenning's avatar Nick Stenning

Remove unused getEndCoords from range.coffee

This is not in upstream and it's not needed any more.
parent 401154b7
......@@ -100,17 +100,6 @@ class Annotator.Plugin.TextSelection extends Annotator.Plugin
type: "text range"
range: r
# Do we have valid page coordinates inside the event
# which has triggered this function?
unless event.pageX
# No, we don't. Adding fake coordinates
pos = selectedRanges[0].getEndCoords()
event.pageX = pos.x
event.pageY = pos.y #- window.scrollY
@annotator.onSuccessfulSelection event
else
@annotator.onFailedSelection event
# Strategies used for creating anchors from saved data
......@@ -369,19 +369,6 @@ class Range.NormalizedRange
range.setEndAfter(@end)
range
# Utility function to bottom-right the coordinates of this range,
# by inserting a test element before it, and taking it's pos.
getEndCoords: ->
me = $ this.end # Get the start element
probe = $ "<span></span>" # Prepare an element for probing
probe.insertAfter me # insert the probe element before the start
pos = probe.offset() # get the position
probe.remove() # remove the probe, restoring the original state
# return the wanted data
x: pos.left
y: pos.top
# Public: A range suitable for storing in local storage or serializing to JSON.
class Range.SerializedRange
......
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