Fixup active casings, shorter prefix detection.

This commit is contained in:
Tom MacWright
2012-11-27 12:01:32 -05:00
parent d8db151553
commit 5260a4522a
3 changed files with 11 additions and 16 deletions
+3 -3
View File
@@ -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 {
+1
View File
@@ -56,6 +56,7 @@ iD.History.prototype = {
}
},
// generate reports of changes for changesets to use
modify: function() {
return this.stack[this.index].creations();
},
+7 -13
View File
@@ -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])]; }