2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-09 14:50:57 +00:00

Merge pull request #520 from swey/pr

switched to box-sizing border-box and removed the expected 1px border…
This commit is contained in:
Tomas Kirda 2016-07-27 09:04:45 -05:00 committed by GitHub
commit 0068bf02ed
4 changed files with 10 additions and 13 deletions

View File

@ -1,7 +1,7 @@
body { font-family: sans-serif; font-size: 14px; line-height: 1.6em; margin: 0; padding: 0; }
.container { width: 800px; margin: 0 auto; }
.autocomplete-suggestions { border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
.autocomplete-suggestions { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
.autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; }
.autocomplete-no-suggestion { padding: 2px 5px;}
.autocomplete-selected { background: #F0F0F0; }

View File

@ -176,7 +176,7 @@
// Only set width if it was provided:
if (options.width !== 'auto') {
container.width(options.width);
container.css('width', options.width);
}
// Listen for mouse over event on suggestions list:
@ -332,9 +332,8 @@
}
}
// -2px to account for suggestions border.
if (that.options.width === 'auto') {
styles.width = (that.el.outerWidth() - 2) + 'px';
styles.width = that.el.outerWidth() + 'px';
}
$container.css(styles);
@ -736,8 +735,8 @@
// Also it adjusts if input width has changed.
// -2px to account for suggestions border.
if (options.width === 'auto') {
width = that.el.outerWidth() - 2;
container.width(width > 0 ? width : 300);
width = that.el.outerWidth();
container.css('width', width > 0 ? width : 300);
}
},

File diff suppressed because one or more lines are too long

View File

@ -176,7 +176,7 @@
// Only set width if it was provided:
if (options.width !== 'auto') {
container.width(options.width);
container.css('width', options.width);
}
// Listen for mouse over event on suggestions list:
@ -332,9 +332,8 @@
}
}
// -2px to account for suggestions border.
if (that.options.width === 'auto') {
styles.width = (that.el.outerWidth() - 2) + 'px';
styles.width = that.el.outerWidth() + 'px';
}
$container.css(styles);
@ -734,10 +733,9 @@
// If width is auto, adjust width before displaying suggestions,
// because if instance was created before input had width, it will be zero.
// Also it adjusts if input width has changed.
// -2px to account for suggestions border.
if (options.width === 'auto') {
width = that.el.outerWidth() - 2;
container.width(width > 0 ? width : 300);
width = that.el.outerWidth();
container.css('width', width > 0 ? width : 300);
}
},