signal-desktop/js/views/confirmation_dialog_view.js

38 lines
954 B
JavaScript
Raw Normal View History

/*
* vim: ts=4:sw=4:expandtab
*/
(function () {
'use strict';
window.Whisper = window.Whisper || {};
Whisper.ConfirmationDialogView = Whisper.View.extend({
2016-02-19 01:28:34 +00:00
className: 'confirmation-dialog modal',
templateName: 'confirmation-dialog',
initialize: function(options) {
this.message = options.message;
this.resolve = options.resolve;
this.reject = options.reject;
this.render();
},
events: {
'click .ok': 'ok',
'click .cancel': 'cancel',
},
render_attributes: function() {
2015-12-26 00:52:04 +00:00
return {
message: this.message,
cancel: i18n('cancel'),
ok: i18n('ok')
};
},
ok: function() {
this.remove();
this.resolve();
},
cancel: function() {
this.remove();
this.reject();
}
});
})();