1
0
mirror of synced 2024-11-29 08:06:03 +03:00

Fix for drop-auto-width collision detection and css border top

- collision detection was not moving the drop left based on the
difference between viewport and relative location of box (dropleft +
dropwidth)
- .select2-drop-active was overriding the .select2-drop-auto-width
making the shifted dropbox look a bit wierd
This commit is contained in:
Jake 2013-11-07 16:21:52 -05:00
parent cb5b684ae5
commit ef9f1dea90
2 changed files with 10 additions and 11 deletions

View File

@ -18,7 +18,6 @@ Version: @@ver@@ Timestamp: @@timestamp@@
/* /*
Force border-box so that % widths fit the parent Force border-box so that % widths fit the parent
container without overlap because of margin/padding. container without overlap because of margin/padding.
More Info : http://www.quirksmode.org/css/box.html More Info : http://www.quirksmode.org/css/box.html
*/ */
-webkit-box-sizing: border-box; /* webkit */ -webkit-box-sizing: border-box; /* webkit */
@ -145,15 +144,6 @@ Version: @@ver@@ Timestamp: @@timestamp@@
box-shadow: 0 4px 5px rgba(0, 0, 0, .15); box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
} }
.select2-drop-auto-width {
border-top: 1px solid #aaa;
width: auto;
}
.select2-drop-auto-width .select2-search {
padding-top: 4px;
}
.select2-drop.select2-drop-above { .select2-drop.select2-drop-above {
margin-top: 1px; margin-top: 1px;
border-top: 1px solid #aaa; border-top: 1px solid #aaa;
@ -174,6 +164,15 @@ Version: @@ver@@ Timestamp: @@timestamp@@
border-top: 1px solid #5897fb; border-top: 1px solid #5897fb;
} }
.select2-drop-auto-width {
border-top: 1px solid #aaa;
width: auto;
}
.select2-drop-auto-width .select2-search {
padding-top: 4px;
}
.select2-container .select2-choice .select2-arrow { .select2-container .select2-choice .select2-arrow {
display: inline-block; display: inline-block;
width: 18px; width: 18px;

View File

@ -1208,7 +1208,7 @@ the specific language governing permissions and limitations under the Apache Lic
} }
if (!enoughRoomOnRight) { if (!enoughRoomOnRight) {
dropLeft = offset.left + width - dropWidth; dropLeft -= (dropLeft + dropWidth) - viewPortRight;
} }
css = { css = {