mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
[third] Don't move typeahead popups when the body scrolls.
Trac #1479 All our typeaheads use this, but I made it an option that must be enabled explicitly since it is not default bootstrap behavior. (imported from commit 97852dc407d1f6dbe46b5fdd2c56d3ed8c6718d2)
This commit is contained in:
16
static/third/bootstrap/js/bootstrap.js
vendored
16
static/third/bootstrap/js/bootstrap.js
vendored
@@ -1826,6 +1826,11 @@
|
||||
this.source = this.options.source
|
||||
this.shown = false
|
||||
this.dropup = this.options.dropup
|
||||
this.fixed = this.options.fixed || false;
|
||||
|
||||
if (this.fixed) {
|
||||
this.$menu.css('position', 'fixed');
|
||||
}
|
||||
// The naturalSearch option causes arrow keys to immediately
|
||||
// update the search box with the underlying values from the
|
||||
// search suggestions.
|
||||
@@ -1854,7 +1859,16 @@
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var pos = $.extend({}, this.$element.offset(), {
|
||||
var pos;
|
||||
|
||||
if (this.fixed) {
|
||||
// Relative to screen instead of to page
|
||||
pos = this.$element[0].getBoundingClientRect();
|
||||
} else {
|
||||
pos = this.$element.offset();
|
||||
}
|
||||
|
||||
pos = $.extend({}, pos, {
|
||||
height: this.$element[0].offsetHeight
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user