priority-nav 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2016 Gijs Rogé
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Gijs Rogé
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md CHANGED
@@ -1,96 +1,106 @@
1
- # PriorityNavigation.js
2
- PriorityNav is a lightweight pure javascript plugin that will move your menu items if they don't fit its parent.
3
- ![Priority Navigation demo](http://gijsroge.github.io/priority-nav.js/priority-nav-demo.gif)
4
-
5
- ####Take a look at the **[Demo](http://gijsroge.github.io/priority-nav.js/)** site.
6
-
7
- ----------
8
-
9
- ### Features
10
- - **Accessible**<br>Adds appropriate aria attributes and set focus to links when needed.
11
- - **No dependencies**<br>The plugin is written in pure javascript making it fast and lean.
12
- - **Breakpoint**<br>When the breakpoint has been reached the plugin will automaticly move all items to the dropdown & change the toggle label to navDropdownBreakpointLabel.
13
- - **Smart calculation of available space**<br>It automatically looks for the main navigation's siblings and calculates remaining space.
14
- - **Flexible**<br>Because of the point above you can have multiple inline-block/flexbox items on the same level.
15
- - **Non obstructive menu dropdown**<br>The dropdown menu can be closed by clicking outside and pressing escape.
16
- - **Callbacks**<br>Callbacks are fired when an item is moved or moved back from the main navigation.
17
-
18
- ### Usage
19
- Load plugin files
20
-
21
- ```html
22
- <!DOCTYPE html>
23
- <head>
24
- <link rel="stylesheet" href="priority-nav-core.css">
25
- </head>
26
-
27
- <body>
28
- <script async src="priority-nav.js"></script>
29
- </body>
30
- ```
31
-
32
- Call plugin without any options.
33
- ```js
34
- var nav = priorityNav.init();
35
- ```
36
- Ideal html structure
37
- ```html
38
- <nav>
39
- <ul> <- needs to be inline-block
40
- <li>menu item</li>
41
- <li>menu item</li>
42
- <li>menu item</li>
43
- <li>menu item</li>
44
- </ul>
45
- </nav>
46
- ```
47
-
48
- ### Options
49
- ```js
50
- initClass: "js-priorityNav", // Class that will be printed on html element to allow conditional css styling.
51
- mainNavWrapper: "nav", // mainnav wrapper selector (must be direct parent from mainNav)
52
- mainNav: "ul", // mainnav selector. (must be inline-block)
53
- navDropdown: ".nav__dropdown", // class used for the dropdown.
54
- navDropdownToggle: ".nav__dropdown-toggle", // class used for the dropdown toggle.
55
- navDropdownLabel: "more", // Text that is used for the dropdown toggle.
56
- navDropdownBreakpointLabel: "menu", //button label for navDropdownToggle when the breakPoint is reached.
57
- breakPoint: 500, //amount of pixels when all menu items should be moved to dropdown to simulate a mobile menu
58
- throttleDelay: 50, // this will throttle the calculating logic on resize because i'm a responsible dev.
59
- offsetPixels: 0, // increase to decrease the time it takes to move an item.
60
- count: true, // prints the amount of items are moved to the attribute data-count to style with css counter.
61
-
62
- //Callbacks
63
- moved: function () {}, // executed when item is moved to dropdown
64
- movedBack: function () {} // executed when item is moved back to main menu
65
- ```
66
-
67
- ### Package managers
68
- - **npm:** `npm --install priority-nav.js`
69
- - **bower:** `bower install priority-nav.js`
70
-
71
- ### Building the source files
72
- ```
73
- #cloning repository
74
- git clone https://github.com/gijsroge/priority-navigation.git
75
- cd priority-navigation
76
-
77
- #dependencies
78
- npm install
79
-
80
- #build files to dist folder
81
- grunt build
82
- ```
83
-
84
- ### IE9 Support
85
- To support Internet Explorer 9 and lower [classList.js](https://github.com/remy/polyfills/blob/master/classList.js/) must be added your page.
86
-
87
- ```html
88
- <!--[if lt IE 9]><script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js"></script><![endif]-->
89
- ```
90
-
91
- ### IE8 Support
92
- To support Internet Explorer 8, [es5-shim](https://github.com/kriskowal/es5-shim/) and classList.js from above must be added your page.
93
-
94
- ```html
95
- <!--[if lt IE 9]><script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js"></script><![endif]-->
96
- ```
1
+ # PriorityNavigation.js
2
+ PriorityNav is a pure javascript plugin that will move your menu items if they don't fit its parent.
3
+ #### Vue.js version **[here](https://github.com/gijsroge/vue-responsive-menu)**.
4
+ ----------
5
+ ![Priority Navigation demo](http://gijsroge.github.io/priority-nav.js/priority-nav-demo.gif)
6
+
7
+ #### Take a look at the **[Demo](http://gijsroge.github.io/priority-nav.js/)** site.
8
+
9
+ ----------
10
+
11
+ ### Features
12
+ - **Accessible**<br>Adds appropriate aria attributes and set focus to links when needed.
13
+ - **No dependencies**<br>The plugin is written in pure javascript making it fast and lean.
14
+ - **Breakpoint**<br>When the breakpoint has been reached the plugin will automaticly move all items to the dropdown & change the toggle label to navDropdownBreakpointLabel.
15
+ - **Smart calculation of available space**<br>It automatically looks for the main navigation's siblings and calculates remaining space.
16
+ - **Flexible**<br>Because of the point above you can have multiple inline-block/flexbox items on the same level.
17
+ - **Non obstructive menu dropdown**<br>The dropdown menu can be closed by clicking outside and pressing escape.
18
+ - **Callbacks**<br>Callbacks are fired when an item is moved or moved back from the main navigation.
19
+
20
+ ### Usage
21
+ Load plugin files
22
+
23
+ ```html
24
+ <!DOCTYPE html>
25
+ <head>
26
+ <link rel="stylesheet" href="priority-nav-core.css">
27
+ </head>
28
+
29
+ <body>
30
+ <script async src="priority-nav.js"></script>
31
+ </body>
32
+ ```
33
+
34
+ Call plugin without any options.
35
+ ```js
36
+ var nav = priorityNav.init();
37
+ ```
38
+ Ideal html structure
39
+ ```html
40
+ <nav>
41
+ <ul> <- needs to be inline-block
42
+ <li>menu item</li>
43
+ <li>menu item</li>
44
+ <li>menu item</li>
45
+ <li>menu item</li>
46
+ </ul>
47
+ </nav>
48
+ ```
49
+
50
+ ### Options
51
+ ```js
52
+ initClass: "js-priorityNav", // Class that will be printed on html element to allow conditional css styling.
53
+ mainNavWrapper: "nav", // mainnav wrapper selector (must be direct parent from mainNav)
54
+ mainNav: "ul", // mainnav selector. (must be inline-block)
55
+ navDropdownClassName: "nav__dropdown", // class used for the dropdown - this is a class name, not a selector.
56
+ navDropdownToggleClassName: "nav__dropdown-toggle", // class used for the dropdown toggle - this is a class name, not a selector.
57
+ navDropdownLabel: "more", // Text that is used for the dropdown toggle.
58
+ navDropdownBreakpointLabel: "menu", //button label for navDropdownToggle when the breakPoint is reached.
59
+ breakPoint: 500, //amount of pixels when all menu items should be moved to dropdown to simulate a mobile menu
60
+ throttleDelay: 50, // this will throttle the calculating logic on resize because i'm a responsible dev.
61
+ offsetPixels: 0, // increase to decrease the time it takes to move an item.
62
+ count: true, // prints the amount of items are moved to the attribute data-count to style with css counter.
63
+
64
+ //Callbacks
65
+ moved: function () {}, // executed when item is moved to dropdown
66
+ movedBack: function () {} // executed when item is moved back to main menu
67
+ ```
68
+
69
+ ### Package managers
70
+ - **npm:** `npm install --save priority-nav`
71
+ - **bower:** `bower install priority-nav.js`
72
+
73
+ ### Building the source files
74
+ ```
75
+ #cloning repository
76
+ git clone https://github.com/gijsroge/priority-navigation.git
77
+ cd priority-navigation
78
+
79
+ #dependencies
80
+ npm install
81
+
82
+ #build files to dist folder
83
+ grunt build
84
+ ```
85
+
86
+ ### IE9 Support
87
+ To support Internet Explorer 9 and lower [classList.js](https://github.com/remy/polyfills/blob/master/classList.js/) must be added your page.
88
+
89
+ ```html
90
+ <!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/2014.01.31/classList.min.js"></script><![endif]-->
91
+ ```
92
+
93
+ ### IE8 Support
94
+ To support Internet Explorer 8, [es5-shim](https://github.com/kriskowal/es5-shim/) and classList.js from above must be added your page.
95
+
96
+ ```html
97
+ <!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js"></script><![endif]-->
98
+ ```
99
+
100
+ ### Alternatives
101
+ * https://github.com/lewie6/ng-priority-nav (angular)
102
+ * https://github.com/matthornsby/priority-navigation (jQuery)
103
+ * https://github.com/352Media/flexMenu (jQuery)
104
+ * https://github.com/VPenkov/okayNav (jQuery)
105
+ * https://github.com/VPenkov/okayNav-vanillaJS (no dependencies)
106
+ * https://github.com/skywalkapps/nav-priority (no dependencies)