mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-03 18:03:38 +00:00
add tooltips to add-field buttons
This commit is contained in:
@@ -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