mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-06 03:11:22 +00:00
A few things going on in this commit: - uiConfirm already has an OK button, so I'm trying to use that instead of uiModal. - The confirm OK button cancels, which is maybe a problem. I might change it. - Dispatch a change event instead of trying to call a function back in uiBackground - Remove some of the custom css, since we already have some shared button css - add utilNoAuto to textarea (this just prevents autocomplete and other annoying behaviors especially in Safari)
40 lines
937 B
JavaScript
40 lines
937 B
JavaScript
import { t } from '../util/locale';
|
|
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 col4')
|
|
.on('click.confirm', function() {
|
|
modalSelection.remove();
|
|
})
|
|
.text(t('confirm.okay'))
|
|
.node()
|
|
.focus();
|
|
|
|
return modalSelection;
|
|
};
|
|
|
|
|
|
return modalSelection;
|
|
}
|