Skip to content

Commit

Permalink
Improve upon last fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Doan committed Feb 12, 2017
1 parent 5bf333c commit 76f688d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dist/js/jquery.prettydropdowns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery Pretty Dropdowns Plugin v3.1.2 by T. H. Doan (http://thdoan.github.io/pretty-dropdowns/)
* jQuery Pretty Dropdowns Plugin v3.1.3 by T. H. Doan (http://thdoan.github.io/pretty-dropdowns/)
*
* jQuery Pretty Dropdowns by T. H. Doan is licensed under the MIT License.
* Read a copy of the license in the LICENSE file or at
Expand Down Expand Up @@ -192,8 +192,11 @@
$clone.remove();
}
// Set dropdown width and event handler
// Add 0.5px slack to prevent missing right border with scrollbar
$dropdown.children('li').width(nWidth+0.5).click(function() {
// NOTE: Setting width using width(), then css() because width() only can
// return a float, which can result in a missing right border when there
// is a scrollbar.
$dropdown.children('li').width(nWidth);
$dropdown.children('li').css('width', $dropdown.children('li').css('width')).click(function() {
var $li = $(this);
// Only update if different value selected
if ($dropdown.hasClass('active') && $li.data('value')!==$dropdown.children('li.selected').data('value')) {
Expand Down

0 comments on commit 76f688d

Please sign in to comment.