2015-09-07 23:53:43 +02:00
|
|
|
/*
|
|
|
|
* vim: ts=4:sw=4:expandtab
|
2015-05-27 01:54:21 +02:00
|
|
|
*/
|
|
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
window.Whisper = window.Whisper || {};
|
|
|
|
|
|
|
|
Whisper.ConfirmationDialogView = Whisper.View.extend({
|
|
|
|
className: 'confirmation-dialog',
|
2015-12-09 00:01:29 +01:00
|
|
|
templateName: 'confirmation-dialog',
|
2015-05-27 01:54:21 +02:00
|
|
|
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 01:52:04 +01:00
|
|
|
return {
|
|
|
|
message: this.message,
|
|
|
|
cancel: i18n('cancel'),
|
|
|
|
ok: i18n('ok')
|
|
|
|
};
|
2015-05-27 01:54:21 +02:00
|
|
|
},
|
|
|
|
ok: function() {
|
|
|
|
this.remove();
|
|
|
|
this.resolve();
|
|
|
|
},
|
|
|
|
cancel: function() {
|
|
|
|
this.remove();
|
|
|
|
this.reject();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})();
|