mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
Fixed compose box PM recipient typeahead handling of focus.
This closes #2315.
This commit is contained in:
@@ -433,13 +433,16 @@ exports.initialize = function () {
|
|||||||
return query_matches_person(current_recipient, item);
|
return query_matches_person(current_recipient, item);
|
||||||
},
|
},
|
||||||
sorter: typeahead_helper.sort_recipientbox_typeahead,
|
sorter: typeahead_helper.sort_recipientbox_typeahead,
|
||||||
updater: function (item) {
|
updater: function (item, event) {
|
||||||
var previous_recipients = exports.get_cleaned_pm_recipients(this.query);
|
var previous_recipients = exports.get_cleaned_pm_recipients(this.query);
|
||||||
previous_recipients.pop();
|
previous_recipients.pop();
|
||||||
previous_recipients = previous_recipients.join(", ");
|
previous_recipients = previous_recipients.join(", ");
|
||||||
if (previous_recipients.length !== 0) {
|
if (previous_recipients.length !== 0) {
|
||||||
previous_recipients += ", ";
|
previous_recipients += ", ";
|
||||||
}
|
}
|
||||||
|
if (event && event.type === 'click') {
|
||||||
|
ui.focus_on('private_message_recipient');
|
||||||
|
}
|
||||||
return previous_recipients + item.email + ", ";
|
return previous_recipients + item.email + ", ";
|
||||||
},
|
},
|
||||||
stopAdvance: true // Do not advance to the next field on a tab or enter
|
stopAdvance: true // Do not advance to the next field on a tab or enter
|
||||||
|
|||||||
8
static/third/bootstrap/js/bootstrap.js
vendored
8
static/third/bootstrap/js/bootstrap.js
vendored
@@ -1843,10 +1843,10 @@
|
|||||||
|
|
||||||
constructor: Typeahead
|
constructor: Typeahead
|
||||||
|
|
||||||
, select: function () {
|
, select: function (e) {
|
||||||
var val = this.$menu.find('.active').data('typeahead-value')
|
var val = this.$menu.find('.active').data('typeahead-value')
|
||||||
this.$element
|
this.$element
|
||||||
.val(this.updater(val))
|
.val(this.updater(val, e))
|
||||||
.change()
|
.change()
|
||||||
return this.hide()
|
return this.hide()
|
||||||
}
|
}
|
||||||
@@ -2067,7 +2067,7 @@
|
|||||||
case 9: // tab
|
case 9: // tab
|
||||||
case 13: // enter
|
case 13: // enter
|
||||||
if (!this.shown) return
|
if (!this.shown) return
|
||||||
this.select()
|
this.select(e)
|
||||||
break
|
break
|
||||||
|
|
||||||
case 27: // escape
|
case 27: // escape
|
||||||
@@ -2098,7 +2098,7 @@
|
|||||||
, click: function (e) {
|
, click: function (e) {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
this.select()
|
this.select(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
, mouseenter: function (e) {
|
, mouseenter: function (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user