Don't use :active pseudo-class

It's slow (500 ms recalculate style vs 1ms).
This commit is contained in:
John Firebaugh
2013-05-11 19:15:04 -07:00
parent feed896baa
commit 9fafd6b56a
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -900,7 +900,7 @@ text.point {
) 9 9, auto;
}
#map:active {
#map.panning {
cursor: pointer; /* Opera */
cursor: url(img/cursor-grabbing.png) 9 9, auto; /* FF */
cursor: -webkit-image-set(
+8
View File
@@ -181,6 +181,12 @@ iD.Map = function(context) {
transformed = true;
supersurface.style(transformProp, transform);
if (tX || tY) {
context.container().selectAll('#map')
.classed('panning', true);
}
queueRedraw();
dispatch.move(map);
@@ -189,6 +195,8 @@ iD.Map = function(context) {
function resetTransform() {
if (!transformed) return false;
supersurface.style(transformProp, '');
context.container().selectAll('#map')
.classed('panning', false);
transformed = false;
return true;
}