mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-04 05:58:09 +02:00
Improve feature list performance
This commit is contained in:
+6
-11
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user