Commit 910d5c6b authored by Randall Leeds's avatar Randall Leeds

Make the toolbar draggable for resizing sidebar

Closes #685
parent caa6ea61
...@@ -102,10 +102,7 @@ class Annotator.Host extends Annotator.Guest ...@@ -102,10 +102,7 @@ class Annotator.Host extends Annotator.Guest
el.width = el.height = 1 el.width = el.height = 1
@element.append el @element.append el
handle = @plugins.Heatmap.element[0] dragStart = (event) =>
handle.draggable = true
handle.addEventListener 'dragstart', (event) =>
event.dataTransfer.dropEffect = 'none' event.dataTransfer.dropEffect = 'none'
event.dataTransfer.effectAllowed = 'none' event.dataTransfer.effectAllowed = 'none'
event.dataTransfer.setData 'text/plain', '' event.dataTransfer.setData 'text/plain', ''
...@@ -118,10 +115,15 @@ class Annotator.Host extends Annotator.Guest ...@@ -118,10 +115,15 @@ class Annotator.Host extends Annotator.Guest
'margin-left': "#{m}px" 'margin-left': "#{m}px"
this.showFrame() this.showFrame()
handle.addEventListener 'dragend', (event) => dragEnd = (event) =>
@drag.enabled = false @drag.enabled = false
@drag.last = null @drag.last = null
for handle in [@plugins.Heatmap.element[0], @plugins.Toolbar.buttons[0]]
handle.draggable = true
handle.addEventListener 'dragstart', dragStart
handle.addEventListener 'dragend', dragEnd
document.addEventListener 'dragover', (event) => document.addEventListener 'dragover', (event) =>
this._dragUpdate event.screenX this._dragUpdate event.screenX
......
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