responsive-nav-rails 1.0.23 → 1.0.24

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06965135b6aeceb6f052ffa15e4861916174a613
4
- data.tar.gz: f044ffa9fb2d0c8e33190df6943eb0456e703774
3
+ metadata.gz: 92b758bbe8f05a6a6105dab0f8e0b15962c08656
4
+ data.tar.gz: 76798d9422e3e14508a12c504d1f098adfc9b41a
5
5
  SHA512:
6
- metadata.gz: bd15a62964756b5d36a44e06c5b16ce189e695a4fc022368ea54c6681ee8a0bf74deb04ae6308d183d361361ca508530ce0cbc410cd7855462316c7ed339e270
7
- data.tar.gz: 993c82076846a0bf8e6779234ccb67746082cfd9de26c0c5e471cc1edd3206f961cea1b84b9cb86e69e210f8173488cc66b7d7542dbff311ba9abb146b2134d9
6
+ metadata.gz: d9e642b26009593e0366064c615127b1866cd9829934a56c2f904a41d2e7ff4b69eae693ec3c8a865debd843379fe2372082c4526710b2bb2fff2375b6730a60
7
+ data.tar.gz: 7772b7767fb08d147710c62eae159082bcbf191748b690f692f4bc67e50b51ddb75eaf638bd3a9062ac9e38a5201eb381f3e95f85c1a3ff2d0de262c36d7225e
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .DS_Store
data/Gemfile CHANGED
File without changes
data/LICENSE.md CHANGED
File without changes
data/README.md CHANGED
@@ -1,27 +1,27 @@
1
- # responsive-nav-rails
2
-
3
- [responsive-nav](http://responsive-nav.com) for the Rails asset pipeline
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- gem "responsive-nav-rails"
10
-
11
- ## Usage
12
-
13
- In your CSS manifest file:
14
-
15
- *= responsive-nav
16
-
17
- In your JavaScript manifest file:
18
-
19
- //= responsive-nav
20
-
21
- or for the minified version
22
-
23
- //= responsive-nav.min
24
-
25
- ## License
26
-
27
- [The MIT License](https://github.com/vevix/responsive-nav-rails/blob/master/LICENSE.md)
1
+ # responsive-nav-rails
2
+
3
+ [responsive-nav](http://responsive-nav.com) for the Rails asset pipeline
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem "responsive-nav-rails"
10
+
11
+ ## Usage
12
+
13
+ In your CSS manifest file:
14
+
15
+ *= require responsive-nav
16
+
17
+ In your JavaScript manifest file:
18
+
19
+ //= require responsive-nav
20
+
21
+ or for the minified version
22
+
23
+ //= require responsive-nav.min
24
+
25
+ ## License
26
+
27
+ [The MIT License](https://github.com/vevix/responsive-nav-rails/blob/master/LICENSE.md)
data/Rakefile CHANGED
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module ResponsiveNavRails
2
- VERSION = "1.0.23"
2
+ VERSION = "1.0.24"
3
3
  end
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- /*! responsive-nav.js 1.0.23
1
+ /*! responsive-nav.js 1.0.24
2
2
  * https://github.com/viljamis/responsive-nav.js
3
3
  * http://responsive-nav.com
4
4
  *
@@ -134,16 +134,17 @@
134
134
 
135
135
  // Default options
136
136
  this.options = {
137
- animate: true, // Boolean: Use CSS3 transitions, true or false
138
- transition: 250, // Integer: Speed of the transition, in milliseconds
139
- label: "Menu", // String: Label for the navigation toggle
140
- insert: "after", // String: Insert the toggle before or after the navigation
141
- customToggle: "", // Selector: Specify the ID of a custom toggle
142
- openPos: "relative", // String: Position of the opened nav, relative or static
143
- jsClass: "js", // String: 'JS enabled' class which is added to <html> el
144
- init: function(){}, // Function: Init callback
145
- open: function(){}, // Function: Open callback
146
- close: function(){} // Function: Close callback
137
+ animate: true, // Boolean: Use CSS3 transitions, true or false
138
+ transition: 250, // Integer: Speed of the transition, in milliseconds
139
+ label: "Menu", // String: Label for the navigation toggle
140
+ insert: "after", // String: Insert the toggle before or after the navigation
141
+ customToggle: "", // Selector: Specify the ID of a custom toggle
142
+ openPos: "relative", // String: Position of the opened nav, relative or static
143
+ navClass: "nav-collapse", // String: Default CSS class. If changed, you need to edit the CSS too!
144
+ jsClass: "js", // String: 'JS enabled' class which is added to <html> element
145
+ init: function(){}, // Function: Init callback
146
+ open: function(){}, // Function: Open callback
147
+ close: function(){} // Function: Close callback
147
148
  };
148
149
 
149
150
  // User defined options
@@ -183,10 +184,9 @@
183
184
  this._removeStyles();
184
185
  removeClass(nav, "closed");
185
186
  removeClass(nav, "opened");
186
- removeClass(nav, "nav-collapse");
187
+ removeClass(nav, opts.navClass);
187
188
  nav.removeAttribute("style");
188
189
  nav.removeAttribute("aria-hidden");
189
- nav = null;
190
190
 
191
191
  removeEvent(window, "resize", this, false);
192
192
  removeEvent(document.body, "touchmove", this, false);
@@ -282,7 +282,7 @@
282
282
 
283
283
  // Private methods
284
284
  _init: function () {
285
- addClass(nav, "nav-collapse");
285
+ addClass(nav, opts.navClass);
286
286
  addClass(nav, "closed");
287
287
  hasAnimFinished = true;
288
288
  navOpen = false;
@@ -421,7 +421,7 @@
421
421
  for (var i = 0; i < nav.inner.length; i++) {
422
422
  savedHeight += nav.inner[i].offsetHeight;
423
423
  }
424
- var innerStyles = ".nav-collapse.opened{max-height:" + savedHeight + "px}";
424
+ var innerStyles = "." + opts.navClass + ".opened{max-height:" + savedHeight + "px}";
425
425
 
426
426
  if (styleElement.styleSheet) {
427
427
  styleElement.styleSheet.cssText = innerStyles;
@@ -1 +1 @@
1
- !function(){"use strict";var a=function(a,b){var c=!!window.getComputedStyle;c||(window.getComputedStyle=function(a){return this.el=a,this.getPropertyValue=function(b){var c=/(\-([a-z]){1})/g;return"float"===b&&(b="styleFloat"),c.test(b)&&(b=b.replace(c,function(){return arguments[2].toUpperCase()})),a.currentStyle[b]?a.currentStyle[b]:null},this});var d,e,f,g,h,i=function(a,b,c,d){if("addEventListener"in a)try{a.addEventListener(b,c,d)}catch(e){if("object"!=typeof c||!c.handleEvent)throw e;a.addEventListener(b,function(a){c.handleEvent.call(c,a)},d)}else"attachEvent"in a&&("object"==typeof c&&c.handleEvent?a.attachEvent("on"+b,function(){c.handleEvent.call(c)}):a.attachEvent("on"+b,c))},j=function(a,b,c,d){if("removeEventListener"in a)try{a.removeEventListener(b,c,d)}catch(e){if("object"!=typeof c||!c.handleEvent)throw e;a.removeEventListener(b,function(a){c.handleEvent.call(c,a)},d)}else"detachEvent"in a&&("object"==typeof c&&c.handleEvent?a.detachEvent("on"+b,function(){c.handleEvent.call(c)}):a.detachEvent("on"+b,c))},k=function(a){if(a.children.length<1)throw new Error("The Nav container has no containing elements");for(var b=[],c=0;c<a.children.length;c++)1===a.children[c].nodeType&&b.push(a.children[c]);return b},l=function(a,b){for(var c in b)a.setAttribute(c,b[c])},m=function(a,b){0!==a.className.indexOf(b)&&(a.className+=" "+b,a.className=a.className.replace(/(^\s*)|(\s*$)/g,""))},n=function(a,b){var c=new RegExp("(\\s|^)"+b+"(\\s|$)");a.className=a.className.replace(c," ").replace(/(^\s*)|(\s*$)/g,"")},o=document.createElement("style"),p=function(a,b){var c;this.options={animate:!0,transition:250,label:"Menu",insert:"after",customToggle:"",openPos:"relative",jsClass:"js",init:function(){},open:function(){},close:function(){}};for(c in b)this.options[c]=b[c];if(m(document.documentElement,this.options.jsClass),this.wrapperEl=a.replace("#",""),document.getElementById(this.wrapperEl))this.wrapper=document.getElementById(this.wrapperEl);else{if(!document.querySelector(this.wrapperEl))throw new Error("The nav element you are trying to select doesn't exist");this.wrapper=document.querySelector(this.wrapperEl)}this.wrapper.inner=k(this.wrapper),e=this.options,d=this.wrapper,this._init(this)};return p.prototype={destroy:function(){this._removeStyles(),n(d,"closed"),n(d,"opened"),n(d,"nav-collapse"),d.removeAttribute("style"),d.removeAttribute("aria-hidden"),d=null,j(window,"resize",this,!1),j(document.body,"touchmove",this,!1),j(f,"touchstart",this,!1),j(f,"touchend",this,!1),j(f,"mouseup",this,!1),j(f,"keyup",this,!1),j(f,"click",this,!1),e.customToggle?f.removeAttribute("aria-hidden"):f.parentNode.removeChild(f)},toggle:function(){g===!0&&(h?(n(d,"opened"),m(d,"closed"),l(d,{"aria-hidden":"true"}),e.animate?(g=!1,setTimeout(function(){d.style.position="absolute",g=!0},e.transition+10)):d.style.position="absolute",h=!1,e.close()):(n(d,"closed"),m(d,"opened"),d.style.position=e.openPos,l(d,{"aria-hidden":"false"}),h=!0,e.open()))},resize:function(){"none"!==window.getComputedStyle(f,null).getPropertyValue("display")?(l(f,{"aria-hidden":"false"}),d.className.match(/(^|\s)closed(\s|$)/)&&(l(d,{"aria-hidden":"true"}),d.style.position="absolute"),this._createStyles(),this._calcHeight()):(l(f,{"aria-hidden":"true"}),l(d,{"aria-hidden":"false"}),d.style.position=e.openPos,this._removeStyles())},handleEvent:function(a){var b=a||window.event;switch(b.type){case"touchstart":this._onTouchStart(b);break;case"touchmove":this._onTouchMove(b);break;case"touchend":case"mouseup":this._onTouchEnd(b);break;case"click":this._preventDefault(b);break;case"keyup":this._onKeyUp(b);break;case"resize":this.resize(b)}},_init:function(){m(d,"nav-collapse"),m(d,"closed"),g=!0,h=!1,this._createToggle(),this._transitions(),this.resize();var a=this;setTimeout(function(){a.resize()},20),i(window,"resize",this,!1),i(document.body,"touchmove",this,!1),i(f,"touchstart",this,!1),i(f,"touchend",this,!1),i(f,"mouseup",this,!1),i(f,"keyup",this,!1),i(f,"click",this,!1),e.init()},_createStyles:function(){o.parentNode||(o.type="text/css",document.getElementsByTagName("head")[0].appendChild(o))},_removeStyles:function(){o.parentNode&&o.parentNode.removeChild(o)},_createToggle:function(){if(e.customToggle){var a=e.customToggle.replace("#","");if(document.getElementById(a))f=document.getElementById(a);else{if(!document.querySelector(a))throw new Error("The custom nav toggle you are trying to select doesn't exist");f=document.querySelector(a)}}else{var b=document.createElement("a");b.innerHTML=e.label,l(b,{href:"#","class":"nav-toggle"}),"after"===e.insert?d.parentNode.insertBefore(b,d.nextSibling):d.parentNode.insertBefore(b,d),f=b}},_preventDefault:function(a){a.preventDefault?(a.preventDefault(),a.stopPropagation()):a.returnValue=!1},_onTouchStart:function(a){a.stopPropagation(),this.startX=a.touches[0].clientX,this.startY=a.touches[0].clientY,this.touchHasMoved=!1,j(f,"mouseup",this,!1)},_onTouchMove:function(a){(Math.abs(a.touches[0].clientX-this.startX)>10||Math.abs(a.touches[0].clientY-this.startY)>10)&&(this.touchHasMoved=!0)},_onTouchEnd:function(a){if(this._preventDefault(a),!this.touchHasMoved){if("touchend"===a.type){this.toggle(a);var b=this;return d.addEventListener("click",b._preventDefault,!0),setTimeout(function(){d.removeEventListener("click",b._preventDefault,!0)},e.transition+100),void 0}var c=a||window.event;3!==c.which&&2!==c.button&&this.toggle(a)}},_onKeyUp:function(a){var b=a||window.event;13===b.keyCode&&this.toggle(a)},_transitions:function(){if(e.animate){var a=d.style,b="max-height "+e.transition+"ms";a.WebkitTransition=b,a.MozTransition=b,a.OTransition=b,a.transition=b}},_calcHeight:function(){for(var a=0,b=0;b<d.inner.length;b++)a+=d.inner[b].offsetHeight;var c=".nav-collapse.opened{max-height:"+a+"px}";o.styleSheet?o.styleSheet.cssText=c:o.innerHTML=c,c=""}},new p(a,b)};window.responsiveNav=a}();
1
+ !function(){"use strict";var a=function(a,b){var c=!!window.getComputedStyle;c||(window.getComputedStyle=function(a){return this.el=a,this.getPropertyValue=function(b){var c=/(\-([a-z]){1})/g;return"float"===b&&(b="styleFloat"),c.test(b)&&(b=b.replace(c,function(){return arguments[2].toUpperCase()})),a.currentStyle[b]?a.currentStyle[b]:null},this});var d,e,f,g,h,i=function(a,b,c,d){if("addEventListener"in a)try{a.addEventListener(b,c,d)}catch(e){if("object"!=typeof c||!c.handleEvent)throw e;a.addEventListener(b,function(a){c.handleEvent.call(c,a)},d)}else"attachEvent"in a&&("object"==typeof c&&c.handleEvent?a.attachEvent("on"+b,function(){c.handleEvent.call(c)}):a.attachEvent("on"+b,c))},j=function(a,b,c,d){if("removeEventListener"in a)try{a.removeEventListener(b,c,d)}catch(e){if("object"!=typeof c||!c.handleEvent)throw e;a.removeEventListener(b,function(a){c.handleEvent.call(c,a)},d)}else"detachEvent"in a&&("object"==typeof c&&c.handleEvent?a.detachEvent("on"+b,function(){c.handleEvent.call(c)}):a.detachEvent("on"+b,c))},k=function(a){if(a.children.length<1)throw new Error("The Nav container has no containing elements");for(var b=[],c=0;c<a.children.length;c++)1===a.children[c].nodeType&&b.push(a.children[c]);return b},l=function(a,b){for(var c in b)a.setAttribute(c,b[c])},m=function(a,b){0!==a.className.indexOf(b)&&(a.className+=" "+b,a.className=a.className.replace(/(^\s*)|(\s*$)/g,""))},n=function(a,b){var c=new RegExp("(\\s|^)"+b+"(\\s|$)");a.className=a.className.replace(c," ").replace(/(^\s*)|(\s*$)/g,"")},o=document.createElement("style"),p=function(a,b){var c;this.options={animate:!0,transition:250,label:"Menu",insert:"after",customToggle:"",openPos:"relative",navClass:"nav-collapse",jsClass:"js",init:function(){},open:function(){},close:function(){}};for(c in b)this.options[c]=b[c];if(m(document.documentElement,this.options.jsClass),this.wrapperEl=a.replace("#",""),document.getElementById(this.wrapperEl))this.wrapper=document.getElementById(this.wrapperEl);else{if(!document.querySelector(this.wrapperEl))throw new Error("The nav element you are trying to select doesn't exist");this.wrapper=document.querySelector(this.wrapperEl)}this.wrapper.inner=k(this.wrapper),e=this.options,d=this.wrapper,this._init(this)};return p.prototype={destroy:function(){this._removeStyles(),n(d,"closed"),n(d,"opened"),n(d,e.navClass),d.removeAttribute("style"),d.removeAttribute("aria-hidden"),j(window,"resize",this,!1),j(document.body,"touchmove",this,!1),j(f,"touchstart",this,!1),j(f,"touchend",this,!1),j(f,"mouseup",this,!1),j(f,"keyup",this,!1),j(f,"click",this,!1),e.customToggle?f.removeAttribute("aria-hidden"):f.parentNode.removeChild(f)},toggle:function(){g===!0&&(h?(n(d,"opened"),m(d,"closed"),l(d,{"aria-hidden":"true"}),e.animate?(g=!1,setTimeout(function(){d.style.position="absolute",g=!0},e.transition+10)):d.style.position="absolute",h=!1,e.close()):(n(d,"closed"),m(d,"opened"),d.style.position=e.openPos,l(d,{"aria-hidden":"false"}),h=!0,e.open()))},resize:function(){"none"!==window.getComputedStyle(f,null).getPropertyValue("display")?(l(f,{"aria-hidden":"false"}),d.className.match(/(^|\s)closed(\s|$)/)&&(l(d,{"aria-hidden":"true"}),d.style.position="absolute"),this._createStyles(),this._calcHeight()):(l(f,{"aria-hidden":"true"}),l(d,{"aria-hidden":"false"}),d.style.position=e.openPos,this._removeStyles())},handleEvent:function(a){var b=a||window.event;switch(b.type){case"touchstart":this._onTouchStart(b);break;case"touchmove":this._onTouchMove(b);break;case"touchend":case"mouseup":this._onTouchEnd(b);break;case"click":this._preventDefault(b);break;case"keyup":this._onKeyUp(b);break;case"resize":this.resize(b)}},_init:function(){m(d,e.navClass),m(d,"closed"),g=!0,h=!1,this._createToggle(),this._transitions(),this.resize();var a=this;setTimeout(function(){a.resize()},20),i(window,"resize",this,!1),i(document.body,"touchmove",this,!1),i(f,"touchstart",this,!1),i(f,"touchend",this,!1),i(f,"mouseup",this,!1),i(f,"keyup",this,!1),i(f,"click",this,!1),e.init()},_createStyles:function(){o.parentNode||(o.type="text/css",document.getElementsByTagName("head")[0].appendChild(o))},_removeStyles:function(){o.parentNode&&o.parentNode.removeChild(o)},_createToggle:function(){if(e.customToggle){var a=e.customToggle.replace("#","");if(document.getElementById(a))f=document.getElementById(a);else{if(!document.querySelector(a))throw new Error("The custom nav toggle you are trying to select doesn't exist");f=document.querySelector(a)}}else{var b=document.createElement("a");b.innerHTML=e.label,l(b,{href:"#","class":"nav-toggle"}),"after"===e.insert?d.parentNode.insertBefore(b,d.nextSibling):d.parentNode.insertBefore(b,d),f=b}},_preventDefault:function(a){a.preventDefault?(a.preventDefault(),a.stopPropagation()):a.returnValue=!1},_onTouchStart:function(a){a.stopPropagation(),this.startX=a.touches[0].clientX,this.startY=a.touches[0].clientY,this.touchHasMoved=!1,j(f,"mouseup",this,!1)},_onTouchMove:function(a){(Math.abs(a.touches[0].clientX-this.startX)>10||Math.abs(a.touches[0].clientY-this.startY)>10)&&(this.touchHasMoved=!0)},_onTouchEnd:function(a){if(this._preventDefault(a),!this.touchHasMoved){if("touchend"===a.type){this.toggle(a);var b=this;return d.addEventListener("click",b._preventDefault,!0),setTimeout(function(){d.removeEventListener("click",b._preventDefault,!0)},e.transition+100),void 0}var c=a||window.event;3!==c.which&&2!==c.button&&this.toggle(a)}},_onKeyUp:function(a){var b=a||window.event;13===b.keyCode&&this.toggle(a)},_transitions:function(){if(e.animate){var a=d.style,b="max-height "+e.transition+"ms";a.WebkitTransition=b,a.MozTransition=b,a.OTransition=b,a.transition=b}},_calcHeight:function(){for(var a=0,b=0;b<d.inner.length;b++)a+=d.inner[b].offsetHeight;var c="."+e.navClass+".opened{max-height:"+a+"px}";o.styleSheet?o.styleSheet.cssText=c:o.innerHTML=c,c=""}},new p(a,b)};window.responsiveNav=a}();
@@ -1,4 +1,4 @@
1
- /*! responsive-nav.js 1.0.23 by @viljamis */
1
+ /*! responsive-nav.js 1.0.24 by @viljamis */
2
2
 
3
3
  .nav-collapse ul {
4
4
  margin: 0;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: responsive-nav-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.23
4
+ version: 1.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas McNiven
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-25 00:00:00.000000000 Z
11
+ date: 2013-11-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: responsive-nav.com for the rails asset pipeline
14
14
  email:
@@ -26,7 +26,6 @@ files:
26
26
  - lib/responsive-nav-rails/engine.rb
27
27
  - lib/responsive-nav-rails/version.rb
28
28
  - responsive-nav-rails.gemspec
29
- - vendor/assets/.DS_Store
30
29
  - vendor/assets/javascripts/responsive-nav.js
31
30
  - vendor/assets/javascripts/responsive-nav.min.js
32
31
  - vendor/assets/stylesheets/responsive-nav.css
Binary file