Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Commit

Permalink
Fixed bug with multiple dropdown menus showing at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliucirlan committed Jul 3, 2020
1 parent eed00a4 commit d2eedfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-mdstrap",
"version": "4.2.1",
"version": "4.2.2",
"description": "jQuery plugin built on top of Bootstrap framework to create mobile menus similar to Google's Material Design",
"main": "dist/js/jquery-mdstrap.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/css/jquery-mdstrap.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* jQuery plugin that enables mobile slide navigation for Bootstrap v4 framework
*
* @version 4.2.1
* @version 4.2.2
* @author Corneliu Cirlan (www.corneliucirlan.com)
*/

Expand Down
14 changes: 7 additions & 7 deletions src/js/jquery-mdstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* jQuery plugin that enables mobile slide navigation for Bootstrap v4 framework
*
* @version 4.2.1
* @version 4.2.2
* @author Corneliu Cirlan (www.corneliucirlan.com)
*/

Expand Down Expand Up @@ -64,16 +64,16 @@
// Window scroll
windowScroll(settings, internalSettings, $menuParent)

if (isTouchEnabled()) {
$('.dropdown').on('click', () => {
$('.dropdown-menu').toggleClass('active')
if (isTouchEnabled()) {
$('.dropdown').on('click', function () {
$(this).children('.dropdown-menu').toggleClass('active')
})
}
else {
$('.dropdown').hover(() => {
$('.dropdown-menu').toggleClass('active')
$('.dropdown').hover(function () {
$(this).children('.dropdown-menu').toggleClass('active')
})
}
}

// Check if device is touch enabled
function isTouchEnabled() {
Expand Down

0 comments on commit d2eedfb

Please sign in to comment.