mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 09:42:56 +00:00
27 lines
757 B
JavaScript
27 lines
757 B
JavaScript
iD.ui.Notice = function(context) {
|
|
return function(selection) {
|
|
var div = selection.append('div')
|
|
.attr('class', 'notice');
|
|
|
|
var button = div.append('button')
|
|
.attr('class', 'zoom-to notice')
|
|
.on('click', function() { context.map().zoom(context.minEditableZoom()); });
|
|
|
|
button.append('span')
|
|
.attr('class', 'icon zoom-in-invert');
|
|
|
|
button.append('span')
|
|
.attr('class', 'label')
|
|
.text(t('zoom_in_edit'));
|
|
|
|
function disableTooHigh() {
|
|
div.style('display', context.editable() ? 'none' : 'block');
|
|
}
|
|
|
|
context.map()
|
|
.on('move.notice', _.debounce(disableTooHigh, 500));
|
|
|
|
disableTooHigh();
|
|
};
|
|
};
|