Skip to content

Commit 669c821

Browse files
committed
Fix popup scroll
1 parent 8b23480 commit 669c821

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

dist/js/selectopus.full.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,11 @@
540540
self.view.popup.items.createList();
541541

542542
var bound = self.$root[0].getBoundingClientRect();
543-
var $body = $('body');
543+
var $document = $(document);
544544

545545
self.$popup.css('width', bound.width);
546-
self.$popup.css('left', bound.left + $body.scrollLeft());
547-
self.$popup.css('top', bound.bottom + $body.scrollTop());
546+
self.$popup.css('left', bound.left + $document.scrollLeft());
547+
self.$popup.css('top', bound.bottom + $document.scrollTop());
548548

549549
self.$popup.appendTo('body');
550550

@@ -667,7 +667,6 @@
667667

668668
self.save();
669669
self.view.items.createList();
670-
671670
},
672671

673672
popup: {
@@ -818,6 +817,7 @@
818817

819818
$.fn.selectopus.languages = {};
820819
})(jQuery);
820+
821821
(function($) {
822822
$.fn.selectopus.languages.en = {
823823
placeholder: 'Click here to select items...',

dist/js/selectopus.full.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/selectopus.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,11 @@
540540
self.view.popup.items.createList();
541541

542542
var bound = self.$root[0].getBoundingClientRect();
543-
var $body = $('body');
543+
var $document = $(document);
544544

545545
self.$popup.css('width', bound.width);
546-
self.$popup.css('left', bound.left + $body.scrollLeft());
547-
self.$popup.css('top', bound.bottom + $body.scrollTop());
546+
self.$popup.css('left', bound.left + $document.scrollLeft());
547+
self.$popup.css('top', bound.bottom + $document.scrollTop());
548548

549549
self.$popup.appendTo('body');
550550

@@ -667,7 +667,6 @@
667667

668668
self.save();
669669
self.view.items.createList();
670-
671670
},
672671

673672
popup: {
@@ -817,4 +816,4 @@
817816
});
818817

819818
$.fn.selectopus.languages = {};
820-
})(jQuery);
819+
})(jQuery);

dist/js/selectopus.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/selectopus.full.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/selectopus.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,11 @@
540540
self.view.popup.items.createList();
541541

542542
var bound = self.$root[0].getBoundingClientRect();
543-
var $body = $('body');
543+
var $document = $(document);
544544

545545
self.$popup.css('width', bound.width);
546-
self.$popup.css('left', bound.left + $body.scrollLeft());
547-
self.$popup.css('top', bound.bottom + $body.scrollTop());
546+
self.$popup.css('left', bound.left + $document.scrollLeft());
547+
self.$popup.css('top', bound.bottom + $document.scrollTop());
548548

549549
self.$popup.appendTo('body');
550550

@@ -667,7 +667,6 @@
667667

668668
self.save();
669669
self.view.items.createList();
670-
671670
},
672671

673672
popup: {
@@ -817,4 +816,4 @@
817816
});
818817

819818
$.fn.selectopus.languages = {};
820-
})(jQuery);
819+
})(jQuery);

0 commit comments

Comments
 (0)