mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-25 15:05:32 +00:00
holding alignment button changes alignment
This commit is contained in:
@@ -223,9 +223,19 @@ iD.ui.Background = function(context) {
|
||||
.append('button')
|
||||
.attr('class', function(d) { return d[0] + ' nudge'; })
|
||||
.text(function(d) { return d[0]; })
|
||||
.on('click', function(d) {
|
||||
context.background().nudge(d[1], context.map().zoom());
|
||||
context.redraw();
|
||||
.on('mousedown', function(d) {
|
||||
|
||||
var interval = window.setInterval(nudge, 100);
|
||||
|
||||
d3.select(this).on('mouseup', function() {
|
||||
window.clearInterval(interval);
|
||||
nudge();
|
||||
});
|
||||
|
||||
function nudge() {
|
||||
context.background().nudge(d[1], context.map().zoom());
|
||||
context.redraw();
|
||||
}
|
||||
});
|
||||
|
||||
nudge_container.append('button')
|
||||
|
||||
Reference in New Issue
Block a user