-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathViewConfirmationDialog.js
More file actions
54 lines (45 loc) · 1.37 KB
/
ViewConfirmationDialog.js
File metadata and controls
54 lines (45 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import $ from 'jquery';
import _ from 'underscore';
import RODAN_EVENTS from 'js/Shared/RODAN_EVENTS';
import Marionette from 'backbone.marionette';
import Radio from 'backbone.radio';
/**
* Password view.
*/
export default class ViewConfirmationDialog extends Marionette.CollectionView
{
initialize(options)
{
this._message = options.message;
this._onConfirm = options.onConfirm;
}
templateContext()
{
return {
message: this._message
};
}
///////////////////////////////////////////////////////////////////////////////////////
// PRIVATE METHODS
///////////////////////////////////////////////////////////////////////////////////////
_handleButtonConfirm()
{
this._onConfirm();
}
_handleButtonCancel()
{
Radio.channel("rodan").request(RODAN_EVENTS.REQUEST__MODAL_HIDE);
}
}
ViewConfirmationDialog.prototype.modelEvents = {
'all': 'render'
};
ViewConfirmationDialog.prototype.ui = {
buttonConfirm: '#button-confirm',
buttonCancel: '#button-cancel'
};
ViewConfirmationDialog.prototype.events = {
'click @ui.buttonConfirm': '_handleButtonConfirm',
'click @ui.buttonCancel': '_handleButtonCancel'
};
ViewConfirmationDialog.prototype.template = _.template($('#template-dialog_confirm').text());