Preserve scroll position in the samples coluns dropdown when reordering [SCI_788]

This commit is contained in:
Oleksii Kriuchykhin 2016-12-13 11:25:35 +01:00
parent e5a0ad9b23
commit de12fac767

View file

@ -914,7 +914,9 @@ function changeToEditMode() {
// loads the columns names in the dropdown list // loads the columns names in the dropdown list
function loadColumnsNames() { function loadColumnsNames() {
// First, clear the list // Save scroll position
var scrollPosition = dropdownList.scrollTop();
// Clear the list
dropdownList.find('li[data-position]').remove(); dropdownList.find('li[data-position]').remove();
_.each(table.columns().header(), function(el, index) { _.each(table.columns().header(), function(el, index) {
if (index > 1) { if (index > 1) {
@ -951,6 +953,8 @@ function changeToEditMode() {
dropdownList.append(html); dropdownList.append(html);
} }
}); });
// Restore scroll position
dropdownList.scrollTop(scrollPosition);
toggleColumnVisibility(); toggleColumnVisibility();
// toggles grip img // toggles grip img
customLiHoverEffect(); customLiHoverEffect();