Improve feature list performance

This commit is contained in:
John Firebaugh
2013-06-04 17:52:09 -07:00
parent f9ecf906d2
commit 1557c6451b
2 changed files with 11 additions and 21 deletions
+6 -11
View File
@@ -737,20 +737,15 @@ a:hover .icon.out-link { background-position: -500px -14px;}
border-bottom: 1px solid #ccc;
}
.feature-list-button-wrap {
position: relative;
margin-bottom: 10px;
height: 60px;
}
.feature-list-button {
.feature-list-item {
width: 100%;
height: 100%;
height: 60px;
margin-bottom: 10px;
position: relative;
border: 1px solid #ccc;
}
.feature-list-button .label {
.feature-list-item .label {
background-color: #f6f6f6;
text-align: left;
position: absolute;
@@ -770,11 +765,11 @@ a:hover .icon.out-link { background-position: -500px -14px;}
border-radius: 0 3px 3px 0;
}
.feature-list-button:hover .label {
.feature-list-item:hover .label {
background-color: #ececec;
}
.feature-list-button .entity-name {
.feature-list-item .entity-name {
font-weight: normal;
padding-left: 10px;
}
+5 -10
View File
@@ -73,21 +73,16 @@ iD.ui.FeatureList = function(context) {
var items = list.selectAll('.feature-list-item')
.data(features(), function(d) { return d.entity.id; });
var enter = items.enter().append('div')
.attr('class', 'feature-list-item');
var wrap = enter.append('div')
.attr('class', 'feature-list-button-wrap col12');
var label = wrap.append('button')
.attr('class', 'feature-list-button')
var enter = items.enter().append('button')
.attr('class', 'feature-list-item')
.call(iD.ui.PresetIcon()
.geometry(function(d) { return d.geometry })
.preset(function(d) { return d.preset; }))
.on('mouseover', function(d) { mouseover(d.entity); })
.on('mouseout', function(d) { mouseout(); })
.on('click', function(d) { click(d.entity); })
.append('div')
.on('click', function(d) { click(d.entity); });
var label = enter.append('div')
.attr('class', 'label');
label.append('span')