Inline image css to fix selector perf, was about 3%

This commit is contained in:
Tom MacWright
2013-01-09 12:53:01 -05:00
parent ee1f7c1da7
commit 9fde54c2c7
2 changed files with 15 additions and 7 deletions
+8 -6
View File
@@ -22,6 +22,13 @@ body {
box-sizing: border-box;
}
/* Mobile Tweaks
------------------------------------------------------- */
* {
-webkit-tap-highlight-color:rgba(0,0,0,0);
-webkit-touch-callout:none;
}
h2 {
font-size: 25px;
line-height: 1.6;
@@ -1035,9 +1042,4 @@ div.typeahead a:first-child {
left: 30px;
}
/* Mobile Tweaks
------------------------------------------------------- */
* {
-webkit-tap-highlight-color:rgba(0,0,0,0);
-webkit-touch-callout:none;
}
+7 -1
View File
@@ -6,6 +6,12 @@ iD.Background = function() {
transformProp = iD.util.prefixCSSProperty('Transform'),
source = d3.functor('');
var imgstyle = 'position:absolute;transform-origin:0 0;' +
'-ms-transform-origin:0 0;' +
'-webkit-transform-origin:0 0;' +
'-moz-transform-origin:0 0;' +
'-o-transform-origin:0 0;';
function atZoom(t, distance) {
var power = Math.pow(2, distance);
var az = [
@@ -82,7 +88,7 @@ iD.Background = function() {
}
image.enter().append('img')
.attr('class', 'tile')
.attr('style', imgstyle)
.attr('src', function(d) { return d[3]; })
.on('error', error)
.on('load', load);