mirror of https://github.com/zulip/zulip.git
compose_typeahead: Ensure header is counted in position calculation.
Previously, there is a bug where the position of the typeahead is off whenever the user switches from stream typeahead to topic typeahead in the compose box. The typeahead header was not hidden before calculation of the position based on container height. These changes will include the header before calculating for the position.
This commit is contained in:
parent
fa37befe3c
commit
edfb2a3948
|
@ -199,6 +199,14 @@ import {get_string_diff} from "../../src/util";
|
|||
}
|
||||
|
||||
, show: function () {
|
||||
var header_text = this.header();
|
||||
if (header_text) {
|
||||
this.$header.find('span#typeahead-header-text').html(header_text);
|
||||
this.$header.show();
|
||||
} else {
|
||||
this.$header.hide();
|
||||
}
|
||||
|
||||
var pos;
|
||||
|
||||
if (this.fixed) {
|
||||
|
@ -230,14 +238,6 @@ import {get_string_diff} from "../../src/util";
|
|||
, left: pos.left
|
||||
})
|
||||
|
||||
var header_text = this.header();
|
||||
if (header_text) {
|
||||
this.$header.find('span#typeahead-header-text').html(header_text);
|
||||
this.$header.show();
|
||||
} else {
|
||||
this.$header.hide();
|
||||
}
|
||||
|
||||
this.$container.show()
|
||||
this.shown = true
|
||||
this.mouse_moved_since_typeahead = false
|
||||
|
|
Loading…
Reference in New Issue