Permalink
Browse files

fix #96 Use atribute matches for the delegate selectors because of th…

…e jQuery bug, which harldy could be fixed
  • Loading branch information...
1 parent 88d4d90 commit c13f9e399b2c64b9efb61dd10d2aceb160c91ffd @bjornd committed Oct 1, 2012
Showing with 9,452 additions and 11 deletions.
  1. +9 −4 lib/world-map.js
  2. +0 −4 tests/assets/jquery-1.7.2.min.js
  3. +9,440 −0 tests/assets/jquery-1.8.2.js
  4. +1 −1 tests/build.html
  5. +1 −1 tests/index.html
  6. +1 −1 tests/markers.html
View
@@ -351,8 +351,9 @@ jvm.WorldMap.prototype = {
mouseMoved = true;
});
- //http://bugs.jquery.com/ticket/10791
- this.container.delegate('.jvectormap-element', 'mouseover mouseout', function(e){
+ /* Can not use common class selectors here because of the bug in jQuery
+ SVG handling, use with caution. */
+ this.container.delegate("[class~='jvectormap-element']", 'mouseover mouseout', function(e){
var path = this,
type = jvm.$(this).attr('class').indexOf('jvectormap-region') === -1 ? 'marker' : 'region',
code = type == 'region' ? jvm.$(this).attr('data-code') : jvm.$(this).attr('data-index'),
@@ -381,11 +382,15 @@ jvm.WorldMap.prototype = {
}
});
- this.container.delegate('.jvectormap-element', 'mousedown', function(e){
+ /* Can not use common class selectors here because of the bug in jQuery
+ SVG handling, use with caution. */
+ this.container.delegate("[class~='jvectormap-element']", 'mousedown', function(e){
mouseMoved = false;
});
- this.container.delegate('.jvectormap-element', 'mouseup', function(e){
+ /* Can not use common class selectors here because of the bug in jQuery
+ SVG handling, use with caution. */
+ this.container.delegate("[class~='jvectormap-element']", 'mouseup', function(e){
var path = this,
type = jvm.$(this).attr('class').indexOf('jvectormap-region') === -1 ? 'marker' : 'region',
code = type == 'region' ? jvm.$(this).attr('data-code') : jvm.$(this).attr('data-index'),

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit c13f9e3

Please sign in to comment.