Permalink
Browse files

some wax leaflet issues fixed

  • Loading branch information...
1 parent afe809d commit e0c8c6f24074b591fcd4bc9ed2e5e6d6ebfc319f @xavijam xavijam committed Jul 12, 2012
Showing with 16 additions and 11 deletions.
  1. +1 −1 examples/custom-popup.html
  2. +12 −7 js/wax.leaf.js
  3. +3 −3 js/wax.leaf.min-6.2.3-touched.js
@@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>CartoDB + Leaflet | Custom infowindow</title>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
- <style>body,html {width:100%; height:100%; margin:0; padding:0; overflow:hidden;} #map {height:100%;}</style>
+ <style>body,html {width:100%; height:100%; margin:0; padding:0; overflow:hidden;} #map {width:100%; height:100%;}</style>
<link rel="stylesheet" href="http://code.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="http://code.leafletjs.com/leaflet-0.3.1/leaflet.ie.css" /><![endif]-->
<link href="../css/style.css" rel="stylesheet" type="text/css">
View
@@ -98,10 +98,11 @@
, stopPropagation = 'stopPropagation'
, createStopPropagation = function (event) {
return function () {
- if (event[stopPropagation])
+ if (event[stopPropagation]) {
event[stopPropagation]()
- else
- event.cancelBubble = true
+ } else {
+ if (typeof event.cancelBubble !== 'unknown') { event.cancelBubble = true; }
+ }
}
}
, createStop = function (synEvent) {
@@ -3164,11 +3165,15 @@ wax.u = {
var htmlComputed = document.body.parentNode.currentStyle;
var topMargin = parseInt(htmlComputed.marginTop, 10) || 0;
var leftMargin = parseInt(htmlComputed.marginLeft, 10) || 0;
+ // return {
+ // x: e.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
+ // (doc && doc.clientLeft || body && body.clientLeft || 0) + leftMargin,
+ // y: e.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) -
+ // (doc && doc.clientTop || body && body.clientTop || 0) + topMargin
+ // };
return {
- x: e.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
- (doc && doc.clientLeft || body && body.clientLeft || 0) + leftMargin,
- y: e.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) -
- (doc && doc.clientTop || body && body.clientTop || 0) + topMargin
+ x: e.clientX,
+ y: e.clientY
};
} else if (e.touches && e.touches.length === 1) {
// Touch browsers
Oops, something went wrong.

0 comments on commit e0c8c6f

Please sign in to comment.