pretty-dropdowns
Advanced tools
Comparing version 4.15.0 to 4.17.0
/*! | ||
* jQuery Pretty Dropdowns Plugin v4.15.0 by T. H. Doan (https://thdoan.github.io/pretty-dropdowns/) | ||
* jQuery Pretty Dropdowns Plugin v4.17.0 by T. H. Doan (https://thdoan.github.io/pretty-dropdowns/) | ||
* | ||
@@ -29,3 +29,3 @@ * jQuery Pretty Dropdowns by T. H. Doan is licensed under the MIT License. | ||
else if (oOptions.height<8) oOptions.height = 8; | ||
if (isNaN(oOptions.hoverIntent) || oOptions.hoverIntent<0) oOptions.hoverIntent = 200; | ||
if (isNaN(oOptions.hoverIntent)) oOptions.hoverIntent = 200; | ||
if (isNaN(oOptions.multiVerbosity)) oOptions.multiVerbosity = 99; | ||
@@ -177,4 +177,5 @@ | ||
$('optgroup, option', $select).filter(function() { | ||
// NOTE: .data('value') can return numeric, so using == comparison instead. | ||
return this.value==$li.data('value') || this.text===$li.contents().filter(function() { | ||
// <option>: this.value = this.text, $li.data('value') = $li.contents() | ||
// <option value="">: this.value = "", $li.data('value') = undefined | ||
return (this.value+'|'+this.text)===($li.data('value')||'')+'|'+$li.contents().filter(function() { | ||
// Filter out selected marker | ||
@@ -241,2 +242,7 @@ return this.nodeType===3; | ||
}); | ||
if (oOptions.hoverIntent<0) { | ||
$(document).click(function(e) { | ||
if ($dropdown.data('hover') && !$dropdown[0].contains(e.target)) resetDropdown($dropdown[0]); | ||
}); | ||
} | ||
// Put focus on menu when user clicks on label | ||
@@ -413,8 +419,4 @@ if (sLabelId) $('#' + sLabelId).off('click', handleFocus).click(handleFocus); | ||
resetDropdown = function(o) { | ||
if (oOptions.hoverIntent<0 && o.type==='mouseleave') return; | ||
var $dropdown = $(o.currentTarget||o); | ||
// NOTE: Sometimes it's possible for $dropdown to point to the wrong element when you | ||
// quickly hover over another menu. To prevent this, we need to check for .active as a | ||
// backup and manually reassign $dropdown. This also requires that it's not clicked on | ||
// because in rare cases the reassignment fails and the reverse menu will not get reset. | ||
if (o.type==='mouseleave' && !$dropdown.hasClass('active') && !$dropdown.data('clicked')) $dropdown = $('.prettydropdown > ul.active'); | ||
$dropdown.data('hover', false); | ||
@@ -421,0 +423,0 @@ clearTimeout(nTimer); |
{ | ||
"name": "pretty-dropdowns", | ||
"version": "4.15.0", | ||
"version": "4.17.0", | ||
"description": "A simple, lightweight jQuery plugin to create stylized drop-down menus.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -63,3 +63,3 @@ # jQuery Pretty Dropdowns | ||
`height` | number | 50 | Drop-down menu height in pixels. The minimum value is 8. Note that the maximum number of items displayed when the menu is opened is determined by the `size` attribute of the `<select>` element. | ||
`hoverIntent` | number | 200 | Wait period (in milliseconds) before collapsing the drop-down menu after you hover off of it. If you hover back onto the menu within the wait period, it will remain open. The minimum value is 0. | ||
`hoverIntent` | number | 200 | Wait period (in milliseconds) before collapsing the drop-down menu after you hover off of it. If you hover back onto the menu within the wait period, it will remain open. To keep the menu open until you click outside of it, set this option to -1. | ||
`multiDelimiter` | string | ; | Separator character to use for the list of selected items in a multi-select menu. | ||
@@ -66,0 +66,0 @@ `multiVerbosity` | number | 99 | Maximum number of selected items to display in a multi-select menu before replacing it with a summary (e.g., "2/3 selected"). To display "0/3 selected" instead of "None selected", set this option to -1. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48157
6
655