Skip to content

Commit 163e93a

Browse files
committed
Remove IDs fixes and bump to 1.0.7
1 parent 2e68c51 commit 163e93a

File tree

10 files changed

+50
-45
lines changed

10 files changed

+50
-45
lines changed

MIT-LICENSE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015 Josh Cope
1+
Copyright (c) 2016 Josh Cope
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1616
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
THE SOFTWARE.
19+
THE SOFTWARE.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SlickNav v1.0.6
1+
# SlickNav v1.0.7
22
## Responsive Mobile Menu jQuery Plugin
33

44
[![Join the chat at https://gitter.im/ComputerWolf/SlickNav](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ComputerWolf/SlickNav?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -53,13 +53,13 @@ slicknav.css can be modified to fit website design
5353
'allowParentLinks': false // Allow clickable links as parent elements.
5454
'nestedParentLinks': true // If false, parent links will be separated from the sub-menu toggle.
5555
'showChildren': false // Show children of parent links by default.
56-
'removeIds': false // Remove IDs from all menu elements. Defaults to true if duplicate is true.
56+
'removeIds': true // Remove IDs from all menu elements. Defaults to false if duplicate set to false.
5757
'removeClasses': false // Remove classes from all menu elements.
5858
'brand': '' // Add branding to menu bar.
59-
59+
6060
### Callbacks
6161
'init': function(){}, // Called after SlickNav creation
62-
'beforeOpen': function(trigger){}, // Called before menu or sub-menu opened.
62+
'beforeOpen': function(trigger){}, // Called before menu or sub-menu opened.
6363
'beforeClose': function(trigger){} // Called before menu or sub-menu closed.
6464
'afterOpen': function(trigger){} // Called after menu or sub-menu opened.
6565
'afterClose': function(trigger){} // Called after menu or sub-menu closed.
@@ -68,21 +68,21 @@ slicknav.css can be modified to fit website design
6868
$('.menu').slicknav('toggle'); // Method to toggle the menu
6969
$('.menu').slicknav('open'); // Method to open the menu
7070
$('.menu').slicknav('close'); // Method to close the menu
71-
71+
7272
Without any additional configuration, both the original and mobile menus will be displayed. It is recommended to use media queries to hide the original menu and display the mobile menu when appropriate. Modernizr or similar can be used for graceful degradation.
7373

7474
For example:
7575

7676
.slicknav_menu {
7777
display:none;
7878
}
79-
79+
8080
@media screen and (max-width: 40em) {
8181
/* #menu is the original menu */
8282
.js #menu {
8383
display:none;
8484
}
85-
85+
8686
.js .slicknav_menu {
8787
display:block;
8888
}

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "slicknav",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"authors": [
55
"Josh Cope"
66
],

dist/jquery.slicknav.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
2-
* SlickNav Responsive Mobile Menu v1.0.6
3-
* (c) 2015 Josh Cope
2+
* SlickNav Responsive Mobile Menu v1.0.7
3+
* (c) 2016 Josh Cope
44
* licensed under MIT
55
*/
66
;(function ($, document, window) {
@@ -21,7 +21,7 @@
2121
allowParentLinks: false,
2222
nestedParentLinks: true,
2323
showChildren: false,
24-
removeIds: false,
24+
removeIds: true,
2525
removeClasses: false,
2626
removeStyles: false,
2727
brand: '',
@@ -43,6 +43,11 @@
4343
// future instances of the plugin
4444
this.settings = $.extend({}, defaults, options);
4545

46+
// Don't remove IDs by default if duplicate is false
47+
if (!this.settings.duplicate && !options.hasOwnProperty("removeIds")) {
48+
this.settings.removeIds = false;
49+
}
50+
4651
this._defaults = defaults;
4752
this._name = mobileMenu;
4853

@@ -59,19 +64,16 @@
5964
// clone menu if needed
6065
if (settings.duplicate) {
6166
$this.mobileNav = menu.clone();
62-
//remove ids from clone to prevent css issues
63-
$this.mobileNav.removeAttr('id');
64-
$this.mobileNav.find('*').each(function (i, e) {
65-
$(e).removeAttr('id');
66-
});
6767
} else {
6868
$this.mobileNav = menu;
69+
}
6970

70-
// remove ids if set
71-
$this.mobileNav.removeAttr('id');
72-
$this.mobileNav.find('*').each(function (i, e) {
73-
$(e).removeAttr('id');
74-
});
71+
// remove IDs if set
72+
if (settings.removeIds) {
73+
$this.mobileNav.removeAttr('id');
74+
$this.mobileNav.find('*').each(function (i, e) {
75+
$(e).removeAttr('id');
76+
});
7577
}
7678

7779
// remove classes if set
@@ -81,7 +83,7 @@
8183
$(e).removeAttr('class');
8284
});
8385
}
84-
86+
8587
// remove styles if set
8688
if (settings.removeStyles) {
8789
$this.mobileNav.removeAttr('style');

dist/jquery.slicknav.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/slicknav.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
2-
* SlickNav Responsive Mobile Menu v1.0.6
3-
* (c) 2015 Josh Cope
2+
* SlickNav Responsive Mobile Menu v1.0.7
3+
* (c) 2016 Josh Cope
44
* licensed under MIT
55
*/
66
.slicknav_btn {

0 commit comments

Comments
 (0)