Remove transitionend event from GL dropdown
This commit is contained in:
parent
325fdc9f1f
commit
f3f9dedcf7
1 changed files with 8 additions and 16 deletions
|
@ -300,7 +300,7 @@ GitLabDropdown = (function() {
|
||||||
return function(data) {
|
return function(data) {
|
||||||
_this.fullData = data;
|
_this.fullData = data;
|
||||||
_this.parseData(_this.fullData);
|
_this.parseData(_this.fullData);
|
||||||
_this.focusTextInput(true);
|
_this.focusTextInput();
|
||||||
if (_this.options.filterable && _this.filter && _this.filter.input && _this.filter.input.val() && _this.filter.input.val().trim() !== '') {
|
if (_this.options.filterable && _this.filter && _this.filter.input && _this.filter.input.val() && _this.filter.input.val().trim() !== '') {
|
||||||
return _this.filter.input.trigger('input');
|
return _this.filter.input.trigger('input');
|
||||||
}
|
}
|
||||||
|
@ -790,9 +790,8 @@ GitLabDropdown = (function() {
|
||||||
return [selectedObject, isMarking];
|
return [selectedObject, isMarking];
|
||||||
};
|
};
|
||||||
|
|
||||||
GitLabDropdown.prototype.focusTextInput = function(triggerFocus = false) {
|
GitLabDropdown.prototype.focusTextInput = function() {
|
||||||
if (this.options.filterable) {
|
if (this.options.filterable) {
|
||||||
this.dropdown.one('transitionend', () => {
|
|
||||||
const initialScrollTop = $(window).scrollTop();
|
const initialScrollTop = $(window).scrollTop();
|
||||||
|
|
||||||
if (this.dropdown.is('.open')) {
|
if (this.dropdown.is('.open')) {
|
||||||
|
@ -802,13 +801,6 @@ GitLabDropdown = (function() {
|
||||||
if ($(window).scrollTop() < initialScrollTop) {
|
if ($(window).scrollTop() < initialScrollTop) {
|
||||||
$(window).scrollTop(initialScrollTop);
|
$(window).scrollTop(initialScrollTop);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
if (triggerFocus) {
|
|
||||||
// This triggers after a ajax request
|
|
||||||
// in case of slow requests, the dropdown transition could already be finished
|
|
||||||
this.dropdown.trigger('transitionend');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue