Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions src/assets/lib/multiple-select/multiple-select.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* @version 1.3.9
* @version 1.3.10
*
* http://wenzhixin.net.cn/p/multiple-select/
*
Expand Down Expand Up @@ -631,9 +631,9 @@
var msDropHeight = this.$drop.outerHeight() || 0;
var msDropWidth = this.$drop.outerWidth() || 0;
var selectOffsetTop = this.$parent.offset().top;
var selectOffsetLeft = this.$parent.offset().left;
var selectParentWidth = this.$parent.width();
var spaceBottom = this.availableSpaceBottom();
var spaceLeft = this.availableSpaceLeft();
var spaceTop = this.availableSpaceTop();
var windowWidth = $(window).width();

Expand Down Expand Up @@ -662,8 +662,8 @@
}

// auto-adjust left/right position
if ((windowWidth - msDropWidth) < spaceLeft) {
var newLeftOffset = spaceLeft - (msDropWidth - selectParentWidth);
if ((windowWidth - msDropWidth) < selectOffsetLeft) {
var newLeftOffset = selectOffsetLeft - (msDropWidth - selectParentWidth);
this.$drop.offset({ left: newLeftOffset });
}

Expand Down Expand Up @@ -725,12 +725,6 @@
return windowHeight - (msDropOffsetTop - pageScroll);
},

availableSpaceLeft: function () {
var pageScrollLeft = $(window).scrollLeft() || 0;
var msDropOffsetLeft = this.$parent.offset().left;
return msDropOffsetLeft - pageScrollLeft;
},

availableSpaceTop: function () {
var pageScroll = $(window).scrollTop() || 0;
var msDropOffsetTop = this.$parent.offset().top;
Expand Down