VulpesOS/gaia/apps/costcontrol/js/views/ConfirmDialog.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

31 lines
871 B
JavaScript
Executable file

'use strict';
/* global Common */
function ConfirmDialog(container, viewManager) {
this.id = container.id;
this.container = container;
this.viewManager = viewManager;
this.message = container.querySelector('p');
this.okButton = container.querySelector('.danger');
this.cancelButton = container.querySelector('.close-reset-dialog');
this.cancelButton.onclick = this.closeConfirmDialog.bind(this);
}
ConfirmDialog.prototype.setMessage = function(l10nId, data) {
Common.localize(this.message, l10nId, data || {});
};
ConfirmDialog.prototype.updateAcceptAction = function(acceptAction) {
this.okButton.onclick = acceptAction;
};
ConfirmDialog.prototype.showConfirmDialog = function() {
this.viewManager.changeViewTo(this.id, '#settings-view');
};
ConfirmDialog.prototype.closeConfirmDialog = function() {
this.viewManager.closeCurrentView();
};