mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
Consolidate localization behavior and init to a coreLocalizer function and singleton Explicitly support `en-US` locale Rename coreData to coreFileFetcher and export a singleton rather than using a property of coreContext Add `apiConnections` property of coreContext to simplify adding a source switcher Replace some init functions with re-callable, promise-supporting `ensureLoaded` functions Make coreContext itself load the UI if a container has been specified at init time Fix code tests
40 lines
935 B
JavaScript
40 lines
935 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();
|
|
})
|
|
.text(t('confirm.okay'))
|
|
.node()
|
|
.focus();
|
|
|
|
return modalSelection;
|
|
};
|
|
|
|
|
|
return modalSelection;
|
|
}
|