2015-09-07 23:53:43 +02:00
|
|
|
/*
|
|
|
|
* vim: ts=4:sw=4:expandtab
|
2015-02-18 03:03:05 +01:00
|
|
|
*/
|
|
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
window.Whisper = window.Whisper || {};
|
|
|
|
|
|
|
|
Whisper.KeyConflictDialogueView = Backbone.View.extend({
|
|
|
|
className: 'key-conflict-dialogue',
|
|
|
|
initialize: function(options) {
|
|
|
|
this.template = $('#key-conflict-dialogue').html();
|
|
|
|
Mustache.parse(this.template);
|
|
|
|
this.conversation = options.conversation;
|
|
|
|
},
|
|
|
|
events: {
|
|
|
|
'click .verify': 'triggerVerify',
|
|
|
|
'click .resolve': 'resolve',
|
|
|
|
'click .cancel': 'remove',
|
|
|
|
'click': 'clickOut'
|
|
|
|
},
|
|
|
|
triggerVerify: function() {
|
2015-07-20 23:15:38 +02:00
|
|
|
this.trigger('verify', {identityKey: this.model.identityKey});
|
2015-02-18 03:03:05 +01:00
|
|
|
},
|
|
|
|
clickOut: function(e) {
|
|
|
|
if (!$(e.target).closest('.content').length) {
|
|
|
|
this.remove();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
resolve: function() {
|
|
|
|
this.trigger('resolve');
|
|
|
|
this.remove();
|
2015-09-15 20:02:17 +02:00
|
|
|
this.conversation.resolveConflicts(this.model);
|
2015-02-18 03:03:05 +01:00
|
|
|
},
|
|
|
|
render: function() {
|
|
|
|
this.$el.html(Mustache.render(this.template, this.model));
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})();
|