From fe32ca9d03ca27ed0b7d5d22400a3b374470f700 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Mon, 11 Feb 2013 12:36:21 -0500 Subject: [PATCH] Yep, detecting opera. Goal can be achieved with two different svg styles, but Opera only implements one, Firefox the other. Can't apply both because Chrome implements both. --- css/map.css | 6 ++++++ js/id/id.js | 2 ++ js/id/ui.js | 2 ++ 3 files changed, 10 insertions(+) diff --git a/css/map.css b/css/map.css index 885c8195c..bea6edde3 100644 --- a/css/map.css +++ b/css/map.css @@ -648,7 +648,13 @@ text.pointlabel { } .pathlabel .textpath { + dominant-baseline: middle; +} + +/* Opera doesn't support dominant-baseline */ +.opera .pathlabel .textpath { baseline-shift: -33%; + dominant-baseline: auto; } .pointlabel-halo, diff --git a/js/id/id.js b/js/id/id.js index 665e0b0a1..df986bc5f 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -127,6 +127,8 @@ iD.detect = function() { browser.support = true; } + browser.opera = ua.indexOf('Opera') >= 0; + browser.locale = navigator.language; function nav(x) { diff --git a/js/id/ui.js b/js/id/ui.js index 529d8bca5..ecab88470 100644 --- a/js/id/ui.js +++ b/js/id/ui.js @@ -12,6 +12,8 @@ iD.ui = function(context) { return; } + if (iD.detect().opera) container.classed('opera', true); + function hintprefix(x, y) { return '' + y + '' + '
' + x + '
'; }