pretty-dropdowns
Advanced tools
Comparing version 4.6.0 to 4.7.0
/*! | ||
* jQuery Pretty Dropdowns Plugin v4.6.0 by T. H. Doan (http://thdoan.github.io/pretty-dropdowns/) | ||
* jQuery Pretty Dropdowns Plugin v4.7.0 by T. H. Doan (http://thdoan.github.io/pretty-dropdowns/) | ||
* | ||
@@ -22,3 +22,3 @@ * jQuery Pretty Dropdowns by T. H. Doan is licensed under the MIT License. | ||
oOptions.selectedMarker = ' <span aria-hidden="true">' + oOptions.selectedMarker + '</span>'; | ||
oOptions.selectedMarker = ' <span aria-hidden="true" class="checked">' + oOptions.selectedMarker + '</span>'; | ||
// Validate options | ||
@@ -126,7 +126,7 @@ if (isNaN(oOptions.height) || oOptions.height<8) oOptions.height = 8; | ||
if (bMultiple) { | ||
if ($li.children('span').length) $li.children('span').remove(); | ||
if ($li.children('span.checked').length) $li.children('span.checked').remove(); | ||
else $li.append(oOptions.selectedMarker); | ||
// Sync <select> element | ||
$dropdown.children(':not(.selected)').each(function(nIndex) { | ||
$('optgroup, option', $select).eq(nIndex).prop('selected', $(this).children('span').length>0); | ||
$('optgroup, option', $select).eq(nIndex).prop('selected', $(this).children('span.checked').length>0); | ||
}); | ||
@@ -336,3 +336,3 @@ // Update selected values for multi-select menu | ||
if (elOpt.parentNode.nodeName==='OPTGROUP') sGroup = elOpt.parentNode.getAttribute('label'); | ||
sText = elOpt.text; | ||
sText = (elOpt.getAttribute('data-prefix') || '') + elOpt.text + (elOpt.getAttribute('data-suffix') || ''); | ||
break; | ||
@@ -339,0 +339,0 @@ case 'OPTGROUP': |
{ | ||
"name": "pretty-dropdowns", | ||
"version": "4.6.0", | ||
"version": "4.7.0", | ||
"description": "A simple, lightweight jQuery plugin to create stylized drop-down menus.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
# jQuery Pretty Dropdowns | ||
Pretty Dropdowns is a simple, lightweight jQuery plugin that converts `<select>` drop-down menus into "pretty" menus that you can style using CSS. | ||
Pretty Dropdowns is a simple, lightweight jQuery plugin that converts `<select>` drop-down menus into "pretty" menus that you can skin using CSS. | ||
@@ -8,5 +8,6 @@ ### Features: | ||
- Two arrow styles and sizes to choose from (or add your own style) | ||
- Easily add icons, thumbnails, and other custom HTML to the menu items | ||
- Support for multiple-select lists (`<select multiple>`) | ||
- Support for option groups (`<optgroup>`) | ||
- Tooltips (`title`) carried over at both `<select>` and `<option>` levels | ||
- Tooltips (`title`) carried over at `<select>`, `<option>`, and `<optgroup>` levels | ||
- Full keyboard navigation (you can even go directly to a menu item by typing its text) | ||
@@ -84,2 +85,6 @@ - Auto-linked to `<label for>` (menu will get focus when you click on the label) | ||
## Data Attributes | ||
The `data-prefix` and `data-suffix` attributes can be added to the `<option>` elements to insert custom HTML before and after each menu item, respectively. You can make use of these attributes to add icons, thumbnails, badges, etc. to the menu items. A good example can be seen [in the demo](https://thdoan.github.io/pretty-dropdowns/demo.html#example-spell). | ||
## Keyboard Navigation | ||
@@ -86,0 +91,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
37331
132