mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 09:42:56 +00:00
add tooltips to add-field buttons
This commit is contained in:
@@ -743,6 +743,15 @@ button.preset-add-field {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.preset-add-field .tooltip.top .tooltip-arrow {
|
||||
border-top-color: #000;
|
||||
}
|
||||
|
||||
.preset-add-field .tooltip-inner {
|
||||
background: #000;
|
||||
color: #DDD;
|
||||
}
|
||||
|
||||
.preset-fav button.fav {
|
||||
height: 30px;
|
||||
margin: 5px;
|
||||
|
||||
@@ -51,11 +51,17 @@ iD.ui.preset = function(context) {
|
||||
.enter()
|
||||
.append('button')
|
||||
.attr('class', 'preset-add-field')
|
||||
.attr('title', function(d) { return d.label(); })
|
||||
.on('click', addForm)
|
||||
.each(tooltip)
|
||||
.append('span')
|
||||
.attr('class', function(d) { return 'icon ' + d.icon; });
|
||||
|
||||
function tooltip(d) {
|
||||
d3.select(this).call(bootstrap.tooltip()
|
||||
.placement('top')
|
||||
.title(d.label()));
|
||||
}
|
||||
|
||||
function addForm(d) {
|
||||
draw(formwrap, [d]);
|
||||
d3.select(this).remove();
|
||||
|
||||
Reference in New Issue
Block a user