Skip to content

Commit

Permalink
Improve timestamp; fix issue #13
Browse files Browse the repository at this point in the history
  • Loading branch information
thdoan committed Jun 9, 2019
1 parent c2f1ecd commit 49afa5f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pretty-dropdowns",
"description": "A simple, lightweight jQuery plugin to create stylized drop-down menus.",
"version": "4.13.0",
"version": "4.15.0",
"main": [
"dist/css/prettydropdowns.css",
"dist/js/jquery.prettydropdowns.js"
Expand Down
12 changes: 8 additions & 4 deletions dist/js/jquery.prettydropdowns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery Pretty Dropdowns Plugin v4.13.0 by T. H. Doan (https://thdoan.github.io/pretty-dropdowns/)
* jQuery Pretty Dropdowns Plugin v4.15.0 by T. H. Doan (https://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 https://choosealicense.com/licenses/mit/
Expand Down Expand Up @@ -58,7 +58,7 @@
$select.data('size', nSize).removeAttr('size');
// Set <select> height to reserve space for <div> container
$select.css('visibility', 'hidden').outerHeight(oOptions.height);
nTimestamp = +new Date();
nTimestamp = performance.now()*100000000000000;
// Test whether to add 'aria-labelledby'
if (elSel.id) {
// Look for <label>
Expand Down Expand Up @@ -420,18 +420,22 @@
if ($dropdown.hasClass('reverse') && !oOptions.classic) $dropdown.prepend($dropdown.children(':last-child'));
$dropdown.removeClass('active reverse').removeData('clicked').attr('aria-expanded', 'false').css('height', '');
$dropdown.children().removeClass('hover nohover');
// Update focus for NVDA screen readers
$dropdown.attr('aria-activedescendant', $dropdown.children('.selected').attr('id'));
}, (o.type==='mouseleave' && !$dropdown.data('clicked')) ? oOptions.hoverIntent : 0);
},

// Set menu item hover state
// bNoScroll set on hoverDropdownItem()
toggleHover = function($li, bOn, bNoScroll) {
if (bOn) {
var $dropdown = $li.parent();
$li.removeClass('nohover').addClass('hover');
// Update focus for NVDA screen readers
$dropdown.attr('aria-activedescendant', $li.attr('id'));
if ($li.length===1 && $current && !bNoScroll) {
// Ensure items are always in view
var $dropdown = $li.parent(),
nDropdownHeight = $dropdown.outerHeight(),
var nDropdownHeight = $dropdown.outerHeight(),
nItemOffset = $li.offset().top-$dropdown.offset().top-1; // -1px for top border
if ($li.index()===0) {
$dropdown.scrollTop(0);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pretty-dropdowns",
"version": "4.13.0",
"version": "4.15.0",
"description": "A simple, lightweight jQuery plugin to create stylized drop-down menus.",
"keywords": [
"jquery-plugin",
Expand Down

0 comments on commit 49afa5f

Please sign in to comment.