Handle contact selection. update #215
This commit is contained in:
parent
c17f085d30
commit
0a7d05c0e5
13
converse.js
13
converse.js
@ -2011,7 +2011,8 @@
|
||||
},
|
||||
|
||||
initTypeAheadInviteWidget: function () {
|
||||
this.$('input.invited-contact').typeahead({
|
||||
var $el = this.$('input.invited-contact');
|
||||
$el.typeahead({
|
||||
minLength: 1,
|
||||
highlight: true
|
||||
}, {
|
||||
@ -2027,6 +2028,16 @@
|
||||
suggestion: _.template('<p data-jid="{{jid}}">{{value}}</p>')
|
||||
}
|
||||
});
|
||||
|
||||
$el.on('typeahead:selected', function (ev, suggestion, dname) {
|
||||
var result = confirm(__("Do you want to invite "+ suggestion.value +" to this chat room?"));
|
||||
if (result === true) {
|
||||
alert(suggestion.jid);
|
||||
} else {
|
||||
$(this).val('');
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user