|
729 | 729 | this.classList.remove('ui-state-hover');
|
730 | 730 | })
|
731 | 731 | // option label
|
732 |
| - .on('mouseenter.multiselect', 'label', function() { |
| 732 | + .on('mouseenter.multiselect', 'label', function(e, param) { |
733 | 733 | if (!this.classList.contains('ui-state-disabled')) {
|
734 | 734 | var checkboxes = self.$checkboxes[0];
|
735 | 735 | var scrollLeft = checkboxes.scrollLeft;
|
|
741 | 741 | $(this).addClass('ui-state-hover').find('input').focus();
|
742 | 742 |
|
743 | 743 | // Restore scroll positions if altered by setting input focus
|
744 |
| - checkboxes.scrollLeft = scrollLeft; |
745 |
| - checkboxes.scrollTop = scrollTop; |
746 |
| - window.scrollTo(scrollX, scrollY); |
| 744 | + if ( !param || !param.allowScroll ) { |
| 745 | + checkboxes.scrollLeft = scrollLeft; |
| 746 | + checkboxes.scrollTop = scrollTop; |
| 747 | + window.scrollTo(scrollX, scrollY); |
| 748 | + } |
747 | 749 | }
|
748 | 750 | })
|
749 | 751 | // Keyboard navigation of the menu
|
|
1231 | 1233 | var $container = this.$menu.find('ul').last();
|
1232 | 1234 |
|
1233 | 1235 | // move to the first/last
|
1234 |
| - this.$menu.find('label').filter(':visible')[ moveToLast ? 'last' : 'first' ]().trigger('mouseover'); |
| 1236 | + this.$menu.find('label').filter(':visible')[ moveToLast ? 'last' : 'first' ]().trigger('mouseover', {allowScroll: true}); |
1235 | 1237 |
|
1236 | 1238 | // set scroll position
|
1237 | 1239 | $container.scrollTop(moveToLast ? $container.height() : 0);
|
1238 | 1240 | }
|
1239 | 1241 | else {
|
1240 |
| - $next.find('label').filter(':visible')[ moveToLast ? "last" : "first" ]().trigger('mouseover'); |
| 1242 | + $next.find('label').filter(':visible')[ moveToLast ? "last" : "first" ]().trigger('mouseover', {allowScroll: true}); |
1241 | 1243 | }
|
1242 | 1244 | },
|
1243 | 1245 |
|
|
0 commit comments