yenbao1340 / gmaps-utility-library-dev

Automatically exported from code.google.com/p/gmaps-utility-library-dev
0 stars 0 forks source link

extinfowindow doesn't handle mouse wheel scroll events correctly #174

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. In IE8/Opera/Safari open an extinfowindow on a map w scroll wheel zoom
enabled
2. Point to the window
3. Use the scroll wheel

What is the expected output? What do you see instead?
should not zoom the map, as you are pointing at the infowindow, not the map.

What version of the product are you using? On what operating system?
1.1 on Windows XP Opera/IE8/Firefox

Please provide any additional information below.

DOMMouseScroll is Firefox ONLY.  So this code doesn't work:

  var stealEvents = ['mousedown', 'dblclick', 'DOMMouseScroll'];
  for( i=0; i < stealEvents.length; i++ ){
    GEvent.bindDom(this.container_, stealEvents[i], this, this.onClick_);
  }

Oddly enough, using GEvent.bindDom to catch onmousewheel events doesn't
seem to work either.

I changed to:

  var stealEvents = ['mousedown', 'dblclick', 'DOMMouseScroll',
'onmousewheel'];
  for( i=0; i < stealEvents.length; i++ ){
    GEvent.bindDom(this.container_, stealEvents[i], this, this.onClick_);
  }

  // for IE/Opera
  if( (navigator.userAgent.toLowerCase().indexOf('msie') != -1  &&
document.all) || 
                    navigator.userAgent.indexOf('Opera') > -1)  {
        this.container_.attachEvent('onmousewheel', this.onClick_);
  }

  // for safari
  if ( navigator.userAgent.indexOf('AppleWebKit/') > -1)  {
        this.container_.onmousewheel = this.onClick_;
  }

and it seems to work.

Also, please change v1.0 to v1.1 in the comments at the top of the code. 

Original issue reported on code.google.com by douglass...@earthlink.net on 16 Dec 2009 at 8:37

GoogleCodeExporter commented 8 years ago
Thanks, Douglas. If you are interested in contributing more to ExtInfoWindow, 
we could 
add you to the project and have you patch in the code yourself.

Original comment by pamela.fox on 18 Dec 2009 at 7:49

GoogleCodeExporter commented 8 years ago
Pamela,
sure. sign me up.

Original comment by douglass...@earthlink.net on 31 Dec 2009 at 4:43

GoogleCodeExporter commented 8 years ago
Great-- please sign the digital CLA 
(http://code.google.com/legal/individual-cla-
v1.0.html), let me know when that's signed, and I'll add you as a member.

Original comment by pamela.fox on 4 Jan 2010 at 2:43

GoogleCodeExporter commented 8 years ago
ok, signed

Original comment by douglass...@earthlink.net on 4 Jan 2010 at 8:06

GoogleCodeExporter commented 8 years ago

Original comment by jgarfi...@earthlink.net on 3 Feb 2010 at 1:59

GoogleCodeExporter commented 8 years ago

Original comment by douglass...@earthlink.net on 18 May 2010 at 10:18