mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-08 07:21:03 +08:00
Scroll dropdown to top on open [SCI-11741]
This commit is contained in:
parent
78de60e38e
commit
f8f678595b
1 changed files with 4 additions and 5 deletions
|
|
@ -445,14 +445,13 @@ var dropdownSelector = (function() {
|
||||||
// If dropdown disabled or we use it in only tag mode we not open it
|
// If dropdown disabled or we use it in only tag mode we not open it
|
||||||
if (dropdownContainer.hasClass('disabled') || (config.inputTagMode && noOptionsForSelect(selector))) return;
|
if (dropdownContainer.hasClass('disabled') || (config.inputTagMode && noOptionsForSelect(selector))) return;
|
||||||
|
|
||||||
// Each time we open option contianer we must scroll it
|
|
||||||
dropdownContainer.animate({
|
|
||||||
scrollTop: optionContainer.offset().top
|
|
||||||
});
|
|
||||||
|
|
||||||
// Now open/close option container
|
// Now open/close option container
|
||||||
dropdownContainer.toggleClass('open');
|
dropdownContainer.toggleClass('open');
|
||||||
if (dropdownContainer.hasClass('open')) {
|
if (dropdownContainer.hasClass('open')) {
|
||||||
|
// Each time we open option container we must scroll it
|
||||||
|
dropdownContainer.find('.dropdown-container').scrollTop(0);
|
||||||
|
PerfectSb().update_all();
|
||||||
|
|
||||||
// on Open we load new data
|
// on Open we load new data
|
||||||
loadData(selectElement, dropdownContainer);
|
loadData(selectElement, dropdownContainer);
|
||||||
updateDropdownDirection(selectElement, dropdownContainer);
|
updateDropdownDirection(selectElement, dropdownContainer);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue