mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-26 07:23:40 +00:00
Fix walkthrough on Firefox (#1743)
This commit is contained in:
@@ -183,6 +183,13 @@ window.iD = function () {
|
||||
context.zoomIn = map.zoomIn;
|
||||
context.zoomOut = map.zoomOut;
|
||||
|
||||
context.surfaceRect = function() {
|
||||
// Work around a bug in Firefox.
|
||||
// http://stackoverflow.com/questions/18153989/
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=530985
|
||||
return context.surface().node().parentNode.getBoundingClientRect();
|
||||
};
|
||||
|
||||
/* Presets */
|
||||
var presets = iD.presets()
|
||||
.load(iD.data.presets);
|
||||
|
||||
@@ -105,7 +105,7 @@ iD.ui.intro = function(context) {
|
||||
};
|
||||
|
||||
iD.ui.intro.pointBox = function(point, context) {
|
||||
var rect = context.surface().node().getBoundingClientRect();
|
||||
var rect = context.surfaceRect();
|
||||
point = context.projection(point);
|
||||
return {
|
||||
left: point[0] + rect.left - 30,
|
||||
@@ -117,7 +117,7 @@ iD.ui.intro.pointBox = function(point, context) {
|
||||
|
||||
iD.ui.intro.pad = function(box, padding, context) {
|
||||
if (box instanceof Array) {
|
||||
var rect = context.surface().node().getBoundingClientRect();
|
||||
var rect = context.surfaceRect();
|
||||
box = context.projection(box);
|
||||
box = {
|
||||
left: box[0] + rect.left,
|
||||
|
||||
@@ -23,7 +23,7 @@ iD.ui.intro.navigation = function(context, reveal) {
|
||||
|
||||
step.enter = function() {
|
||||
|
||||
var rect = context.surface().node().getBoundingClientRect(),
|
||||
var rect = context.surfaceRect(),
|
||||
map = {
|
||||
left: rect.left + 10,
|
||||
top: rect.top + 70,
|
||||
|
||||
@@ -66,9 +66,7 @@ iD.ui.RadialMenu = function(context, operations) {
|
||||
.attr('class', 'tooltip-inner radial-menu-tooltip');
|
||||
|
||||
function mouseover(d, i) {
|
||||
// Avoid getBoundingClientRect on SVG element; browser implementations
|
||||
// differ: http://stackoverflow.com/questions/18153989/
|
||||
var rect = context.surface().node().parentNode.getBoundingClientRect(),
|
||||
var rect = context.surfaceRect(),
|
||||
angle = a0 + i * a,
|
||||
dx = rect.left - (angle < 0 ? 200 : 0),
|
||||
dy = rect.top;
|
||||
|
||||
Reference in New Issue
Block a user