mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 17:52:55 +00:00
add shorcuts to geocoder/background tooltips
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
iD.ui.Background = function(context) {
|
||||
var event = d3.dispatch('cancel', 'save'),
|
||||
key = 'b',
|
||||
opacities = [1, 0.5, 0];
|
||||
|
||||
var layers = context.backgroundSources();
|
||||
@@ -19,12 +20,13 @@ iD.ui.Background = function(context) {
|
||||
shown = false;
|
||||
|
||||
var tooltip = bootstrap.tooltip()
|
||||
.placement('right');
|
||||
.placement('right')
|
||||
.html(true)
|
||||
.title(iD.ui.tooltipHtml(t('background.description'), key));
|
||||
|
||||
var button = selection.append('button')
|
||||
.attr('tabindex', -1)
|
||||
.attr('class', 'fillD')
|
||||
.attr('title', t('background.description'))
|
||||
.on('click.background-toggle', toggle)
|
||||
.call(tooltip);
|
||||
|
||||
@@ -227,7 +229,7 @@ iD.ui.Background = function(context) {
|
||||
|
||||
var keybinding = d3.keybinding('background');
|
||||
|
||||
keybinding.on('b', toggle);
|
||||
keybinding.on(key, toggle);
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
iD.ui.Geocoder = function(context) {
|
||||
|
||||
var key = 'f';
|
||||
|
||||
function resultExtent(bounds) {
|
||||
return new iD.geo.Extent(
|
||||
[parseFloat(bounds[3]), parseFloat(bounds[0])],
|
||||
@@ -81,11 +84,13 @@ iD.ui.Geocoder = function(context) {
|
||||
shown = show;
|
||||
}
|
||||
}
|
||||
var tooltip = bootstrap.tooltip().placement('right');
|
||||
var tooltip = bootstrap.tooltip()
|
||||
.placement('right')
|
||||
.html(true)
|
||||
.title(iD.ui.tooltipHtml(t('geocoder.title'), key));
|
||||
|
||||
var button = selection.append('button')
|
||||
.attr('tabindex', -1)
|
||||
.attr('title', t('geocoder.title'))
|
||||
.on('click', toggle)
|
||||
.call(tooltip);
|
||||
|
||||
@@ -111,7 +116,7 @@ iD.ui.Geocoder = function(context) {
|
||||
|
||||
var keybinding = d3.keybinding('geocoder');
|
||||
|
||||
keybinding.on('f', toggle);
|
||||
keybinding.on(key, toggle);
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
|
||||
Reference in New Issue
Block a user