bootstrap-submenu
Advanced tools
Comparing version 1.0.7 to 1.1.0
/*! | ||
* Bootstrap-submenu v1.0.7 (http://vsn4ik.github.io/bootstrap-submenu) | ||
* Bootstrap-submenu v1.1.0 (http://vsn4ik.github.io/bootstrap-submenu) | ||
* Copyright 2014 vsn4ik | ||
@@ -25,2 +25,3 @@ * Licensed under MIT (https://github.com/vsn4ik/bootstrap-submenu/blob/master/LICENSE) | ||
this.$element.on('click.bs.dropdown', this.toggle.bind(this)); | ||
this.$menu.keydown(this.keydown.bind(this)); | ||
}, | ||
@@ -37,2 +38,14 @@ toggle: function() { | ||
} | ||
}, | ||
keydown: function() { | ||
// 13: Return, 32: Spacebar | ||
// Off vertical scrolling | ||
if (event.keyCode == 32) { | ||
event.preventDefault(); | ||
} | ||
if (/^(13|32)$/.test(event.keyCode)) { | ||
this.toggle(); | ||
} | ||
} | ||
@@ -39,0 +52,0 @@ }; |
/*! | ||
* Bootstrap-submenu v1.0.7 (http://vsn4ik.github.io/bootstrap-submenu) | ||
* Bootstrap-submenu v1.1.0 (http://vsn4ik.github.io/bootstrap-submenu) | ||
* Copyright 2014 vsn4ik | ||
@@ -7,2 +7,2 @@ * Licensed under MIT (https://github.com/vsn4ik/bootstrap-submenu/blob/master/LICENSE) | ||
"use strict";if("undefined"==typeof jQuery)throw new Error("Bootstrap-submenu requires jQuery");!function(a){function b(b){this.$element=a(b),this.$menu=this.$element.parent(),this.$submenus=this.$menu.parent().find(".dropdown-submenu"),this.init()}b.prototype={init:function(){this.$element.on("click.bs.dropdown",this.toggle.bind(this))},toggle:function(){event.stopPropagation();var a=this.$menu.hasClass("open");this.$submenus.removeClass("open"),a||this.$menu.addClass("open")}},a.fn.submenupicker=function(){return this.each(function(){var c=a(this),d=c.data("bs.submenu");d||(new b(this),c.data("bs.submenu",!0))})}}(jQuery); | ||
"use strict";if("undefined"==typeof jQuery)throw new Error("Bootstrap-submenu requires jQuery");!function(a){function b(b){this.$element=a(b),this.$menu=this.$element.parent(),this.$submenus=this.$menu.parent().find(".dropdown-submenu"),this.init()}b.prototype={init:function(){this.$element.on("click.bs.dropdown",this.toggle.bind(this)),this.$menu.keydown(this.keydown.bind(this))},toggle:function(){event.stopPropagation();var a=this.$menu.hasClass("open");this.$submenus.removeClass("open"),a||this.$menu.addClass("open")},keydown:function(){32==event.keyCode&&event.preventDefault(),/^(13|32)$/.test(event.keyCode)&&this.toggle()}},a.fn.submenupicker=function(){return this.each(function(){var c=a(this),d=c.data("bs.submenu");d||(new b(this),c.data("bs.submenu",!0))})}}(jQuery); |
@@ -19,2 +19,3 @@ 'use strict'; | ||
this.$element.on('click.bs.dropdown', this.toggle.bind(this)); | ||
this.$menu.keydown(this.keydown.bind(this)); | ||
}, | ||
@@ -31,2 +32,14 @@ toggle: function() { | ||
} | ||
}, | ||
keydown: function() { | ||
// 13: Return, 32: Spacebar | ||
// Off vertical scrolling | ||
if (event.keyCode == 32) { | ||
event.preventDefault(); | ||
} | ||
if (/^(13|32)$/.test(event.keyCode)) { | ||
this.toggle(); | ||
} | ||
} | ||
@@ -33,0 +46,0 @@ }; |
{ | ||
"name": "bootstrap-submenu", | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"description": "Bootstrap Sub-Menus", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -9,31 +9,44 @@ # [Bootstrap-submenu](http://vsn4ik.github.io/bootstrap-submenu) | ||
## Getting Started | ||
## Quick start | ||
Three quick start options are available: | ||
* [Download the latest release](https://github.com/vsn4ik/bootstrap-submenu/zipball/master "Download Bootstrap-submenu"). | ||
* Clone the repo: `git clone https://github.com/vsn4ik/bootstrap-submenu.git`. | ||
* Install with [Bower](http://bower.io): `bower install bootstrap-submenu`. | ||
- [Download the latest release](https://github.com/vsn4ik/bootstrap-submenu/zipball/master "Download Bootstrap-submenu"). | ||
- Clone the repo: `git clone https://github.com/vsn4ik/bootstrap-submenu.git`. | ||
- Install with [Bower](http://bower.io): `bower install bootstrap-submenu`. | ||
## Examples | ||
For some working examples, visit our [examples](http://vsn4ik.github.io/bootstrap-submenu/#examples) section. | ||
## Min Requirements | ||
* Bootstrap 3.0.0 | ||
* jQuery 1.9.0 | ||
- Bootstrap 3.0.0 | ||
- jQuery 1.9.0 | ||
## Browser Support | ||
* Google Chrome | ||
* Mozilla Firefox 14+ | ||
* Opera 11+ | ||
* Apple Safari 4+ | ||
* Internet Explorer 7/8 (used with jQuery 1.x) | ||
* Internet Explorer 9+ | ||
- Google Chrome | ||
- Mozilla Firefox 14+ | ||
- Opera 11+ | ||
- Apple Safari 4+ | ||
- Internet Explorer 7/8 (used with jQuery 1.x) | ||
- Internet Explorer 9+ | ||
## Creators | ||
**vsn4ik** | ||
+ <https://github.com/vsn4ik> | ||
## License | ||
- <https://github.com/vsn4ik> | ||
## Copyright and license | ||
Copyright 2014 vsn4ik. | ||
Licensed under [the MIT License](LICENSE). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10841
153
52