mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-19 20:23:12 +00:00
34 lines
834 B
JavaScript
34 lines
834 B
JavaScript
import { modal } from './modal';
|
|
|
|
export function confirm(selection) {
|
|
var modalSelection = modal(selection);
|
|
|
|
modalSelection.select('.modal')
|
|
.classed('modal-alert', true);
|
|
|
|
var section = modalSelection.select('.content');
|
|
|
|
section.append('div')
|
|
.attr('class', 'modal-section header');
|
|
|
|
section.append('div')
|
|
.attr('class', 'modal-section message-text');
|
|
|
|
var buttons = section.append('div')
|
|
.attr('class', 'modal-section buttons cf');
|
|
|
|
modalSelection.okButton = function() {
|
|
buttons
|
|
.append('button')
|
|
.attr('class', 'action col4')
|
|
.on('click.confirm', function() {
|
|
modalSelection.remove();
|
|
})
|
|
.text(t('confirm.okay'));
|
|
|
|
return modalSelection;
|
|
};
|
|
|
|
return modalSelection;
|
|
}
|