Files
iD/modules/ui/confirm.js
Martin Raifer 9f3f8e1366 rename method
2021-11-29 19:26:18 +01:00

40 lines
942 B
JavaScript

import { t } from '../core/localizer';
import { uiModal } from './modal';
export function uiConfirm(selection) {
var modalSelection = uiModal(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', 'button ok-button action')
.on('click.confirm', function() {
modalSelection.remove();
})
.call(t.append('confirm.okay'))
.node()
.focus();
return modalSelection;
};
return modalSelection;
}