Commit 10dafb0e authored by Ujvari Gergely's avatar Ujvari Gergely

Improved cross-browser compatibility.

parent 280fad95
...@@ -107,8 +107,6 @@ class Annotator.Host extends Annotator ...@@ -107,8 +107,6 @@ class Annotator.Host extends Annotator
Math.max.apply(Math, all) Math.max.apply(Math, all)
scrollTop: (y) => scrollTop: (y) =>
$('html, body').stop().animate {scrollTop: y}, 600 $('html, body').stop().animate {scrollTop: y}, 600
debounce: (fn, delay) =>
util.debounce(fn, delay)
remote: remote:
publish: {} publish: {}
addPlugin: {} addPlugin: {}
......
...@@ -70,7 +70,6 @@ class Hypothesis extends Annotator ...@@ -70,7 +70,6 @@ class Hypothesis extends Annotator
setActiveHighlights: {} setActiveHighlights: {}
getMaxBottom: {} getMaxBottom: {}
scrollTop: {} scrollTop: {}
debounce: {}
# Prepare a MarkDown renderer, and add some post-processing # Prepare a MarkDown renderer, and add some post-processing
# so that all created links have their target set to _blank # so that all created links have their target set to _blank
...@@ -129,15 +128,14 @@ class Hypothesis extends Annotator ...@@ -129,15 +128,14 @@ class Hypothesis extends Annotator
if @viewer.isShown() and @bucket == -1 if @viewer.isShown() and @bucket == -1
this._fillDynamicBucket() this._fillDynamicBucket()
this.show() this.show()
document.getElementById('toolbar').addEventListener 'dragstart', (event) => document.getElementsByClassName('tri')[0].addEventListener 'dragstart', (event) =>
@dragstartposX = event.screenX @dragstartposX = event.screenX
document.getElementById('toolbar').addEventListener 'drag', (event, ui) =>
@provider.debounce( =>
@provider.addtoFrameWidth(@dragstartposX - event.screenX, window.innerWidth)
@dragstartposX = event.screenX
, 250)
document.getElementById('toolbar').addEventListener 'dragend', (event) => document.getElementById('toolbar').addEventListener 'dragend', (event) =>
@provider.addtoFrameWidth(@dragstartposX - event.screenX, window.innerWidth) @provider.addtoFrameWidth(@dragstartposX - event.screenX, window.innerWidth)
document.getElementById('toolbar').addEventListener 'drag', (event) =>
if event.screenX > 0
@provider.addtoFrameWidth((@dragstartposX - event.screenX), window.innerWidth)
@dragstartposX = event.screenX
this this
_setupDynamicStyle: -> _setupDynamicStyle: ->
...@@ -564,7 +562,7 @@ class Hypothesis extends Annotator ...@@ -564,7 +562,7 @@ class Hypothesis extends Annotator
@provider.setActiveHighlights annotations @provider.setActiveHighlights annotations
@provider.showFrame() @provider.showFrame()
$("#toolbar").addClass "shown" $("#toolbar").addClass "shown"
$("#toolbar").draggable = true document.getElementsByClassName('tri')[0].draggable = true
hide: => hide: =>
@lastWidth = window.innerWidth @lastWidth = window.innerWidth
...@@ -573,7 +571,7 @@ class Hypothesis extends Annotator ...@@ -573,7 +571,7 @@ class Hypothesis extends Annotator
@provider.resetFrameWidth() @provider.resetFrameWidth()
@provider.hideFrame() @provider.hideFrame()
$("#toolbar").removeClass "shown" $("#toolbar").removeClass "shown"
$("#toolbar").draggable = false document.getElementsByClassName('tri')[0].draggable = false
threadId: (annotation) -> threadId: (annotation) ->
if annotation?.thread? if annotation?.thread?
......
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