From 5260a4522a9ea0be4b9a5ff62889b4a918a85f25 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 27 Nov 2012 12:01:32 -0500 Subject: [PATCH] Fixup active casings, shorter prefix detection. --- css/map.css | 6 +++--- js/iD/graph/History.js | 1 + js/iD/renderer/Map.js | 20 +++++++------------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/css/map.css b/css/map.css index cea15874c..3faaf5dcf 100644 --- a/css/map.css +++ b/css/map.css @@ -46,9 +46,9 @@ path.casing:hover { } path.casing.active { - stroke:#FFF9C9; - stroke-opacity:1; - stroke-width:8; + stroke:#FFF9C9 !important; + stroke-opacity:1 !important; + stroke-width:10 !important; } path.stroke { diff --git a/js/iD/graph/History.js b/js/iD/graph/History.js index a29ee5567..92cb0da4d 100644 --- a/js/iD/graph/History.js +++ b/js/iD/graph/History.js @@ -56,6 +56,7 @@ iD.History.prototype = { } }, + // generate reports of changes for changesets to use modify: function() { return this.stack[this.index].creations(); }, diff --git a/js/iD/renderer/Map.js b/js/iD/renderer/Map.js index 3008d7844..6babd7f8a 100644 --- a/js/iD/renderer/Map.js +++ b/js/iD/renderer/Map.js @@ -81,19 +81,8 @@ iD.Map = function(elem, connection) { arrow.remove(); return alength; })(), - transformProp = (function(props) { - var style = document.documentElement.style; - for (var i = 0; i < props.length; i++) { - if (props[i] in style) return { - transform: 'transform', - WebkitTransform: '-webkit-transform', - OTransform: '-o-transform', - MozTransform: '-moz-transform', - msTransform: '-ms-transform' - }[props[i]]; - } - return false; - })(['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform']); + prefix = prefixMatch(['webkit', 'ms', 'Moz', 'O']), + transformProp = prefix + 'transform'; defs.append('clipPath') .attr('id', 'clip') @@ -103,6 +92,11 @@ iD.Map = function(elem, connection) { var tileclient = iD.Tiles(tilegroup, projection); + function prefixMatch(p) { // via mbostock + var i = -1, n = p.length, s = document.body.style; + while (++i < n) if (p[i] + 'Transform' in s) return '-' + p[i].toLowerCase() + '-'; + return ''; + } function ll2a(o) { return [o.lon, o.lat]; } function a2ll(o) { return { lon: o[0], lat: o[1] }; } function roundCoords(c) { return [Math.floor(c[0]), Math.floor(c[1])]; }