changeset 1618:ab025bf6c3df

let svg receive mouse events in prep for selection support Ignore-this: a4890b7effd0aa31868eb161f71a49fb
author Drew Perttula <drewp@bigasterisk.com>
date Wed, 07 Jun 2017 07:41:06 +0000
parents ff193840cd84
children ce1f94c5ca93
files light9/web/timeline/timeline-elements.html light9/web/timeline/timeline.coffee
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/light9/web/timeline/timeline-elements.html	Wed Jun 07 07:28:37 2017 +0000
+++ b/light9/web/timeline/timeline-elements.html	Wed Jun 07 07:41:06 2017 +0000
@@ -136,12 +136,10 @@
   <template>
     <style>
      :host {
-         pointer-events: none;
      }
      svg {
          width: 100%;
          height: 100%;
-         pointer-events: none;
      }
     </style>
     <svg xmlns="http://www.w3.org/2000/svg"
--- a/light9/web/timeline/timeline.coffee	Wed Jun 07 07:28:37 2017 +0000
+++ b/light9/web/timeline/timeline.coffee	Wed Jun 07 07:41:06 2017 +0000
@@ -96,7 +96,7 @@
 
     @trackMouse()
     @bindKeys()
-    @bindWheelZoom()
+    @bindWheelZoom(@dia.querySelector('svg'))
     @forwardMouseEventsToAdjustersCanvas()
 
     @makeZoomAdjs()
@@ -155,8 +155,8 @@
   latestMouseTime: ->
     @zoomInX.invert(@viewState.mouse.pos().e(1))
 
-  bindWheelZoom: ->
-    @$.zoomed.addEventListener 'mousewheel', (ev) =>
+  bindWheelZoom: (elem) ->
+    elem.addEventListener 'mousewheel', (ev) =>
       zs = @viewState.zoomSpec
 
       center = @latestMouseTime()
@@ -896,6 +896,9 @@
   ready: ->
     @elemById = {}
 
+  attached: ->
+    @querySelector('svg').add
+
   setTimeAxis: (width, yTop, scale) ->
     pxPerTick = 50
     axis = d3.axisTop(scale).ticks(width / pxPerTick)