bootstrap-submenu
Advanced tools
Comparing version 1.1.5 to 1.1.6
/*! | ||
* Bootstrap-submenu v1.1.5 (http://vsn4ik.github.io/bootstrap-submenu) | ||
* Copyright 2014 vsn4ik | ||
* Bootstrap-submenu v1.1.6 (http://vsn4ik.github.io/bootstrap-submenu) | ||
* Copyright 2014 Vasily A. (https://github.com/vsn4ik) | ||
* Licensed under MIT (https://github.com/vsn4ik/bootstrap-submenu/blob/master/LICENSE) | ||
@@ -19,3 +19,4 @@ */ | ||
this.$menu = this.$element.parent(); | ||
this.$submenus = this.$menu.parent().find('.dropdown-submenu').not(this.$menu); | ||
this.$menus = this.$menu.siblings('.dropdown-submenu'); | ||
this.$children = this.$menu.find('> .dropdown-menu > .dropdown-submenu'); | ||
this.$prev = this.$menu.prevAll(desc).children('a'); | ||
@@ -31,2 +32,3 @@ this.$next = this.$menu.nextAll(desc).children('a'); | ||
this.$element.keydown(this.keydown.bind(this)); | ||
this.$menu.on('hide.bs.submenu', this.hide.bind(this)); | ||
}, | ||
@@ -39,5 +41,20 @@ click: function(event) { | ||
toggle: function() { | ||
this.$menu.toggleClass('open'); | ||
this.$submenus.removeClass('open'); | ||
if (this.$menu.hasClass('open')) { | ||
this.close(); | ||
} | ||
else { | ||
this.$menu.addClass('open'); | ||
this.$menus.trigger('hide.bs.submenu'); | ||
} | ||
}, | ||
hide: function(event) { | ||
// Stop event bubbling | ||
event.stopPropagation(); | ||
this.close(); | ||
}, | ||
close: function() { | ||
this.$menu.removeClass('open'); | ||
this.$children.trigger('hide.bs.submenu'); | ||
}, | ||
keydown: function(event) { | ||
@@ -44,0 +61,0 @@ // 13: Return, 32: Spacebar |
/*! | ||
* Bootstrap-submenu v1.1.5 (http://vsn4ik.github.io/bootstrap-submenu) | ||
* Copyright 2014 vsn4ik | ||
* Bootstrap-submenu v1.1.6 (http://vsn4ik.github.io/bootstrap-submenu) | ||
* Copyright 2014 Vasily A. (https://github.com/vsn4ik) | ||
* 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){var c=":not(.disabled, .divider, .dropdown-header):first";this.$element=a(b),this.$menu=this.$element.parent(),this.$submenus=this.$menu.parent().find(".dropdown-submenu").not(this.$menu),this.$prev=this.$menu.prevAll(c).children("a"),this.$next=this.$menu.nextAll(c).children("a"),this.init()}b.prototype={init:function(){this.$element.on("click.bs.dropdown",this.click.bind(this)),this.$element.keydown(this.keydown.bind(this))},click:function(a){a.stopPropagation(),this.toggle()},toggle:function(){this.$menu.toggleClass("open"),this.$submenus.removeClass("open")},keydown:function(a){/^(32|38|40)$/.test(a.keyCode)&&a.preventDefault(),/^(13|32)$/.test(a.keyCode)?this.toggle():/^(38|40)$/.test(a.keyCode)&&(a.stopPropagation(),38==a.keyCode?this.$prev.focus():40==a.keyCode&&this.$next.focus())}},a.fn.submenupicker=function(){return this.each(function(){var c=a.data(this,"bs.submenu");c||(new b(this),a.data(this,"bs.submenu",!0))})}}(jQuery); | ||
"use strict";if("undefined"==typeof jQuery)throw new Error("Bootstrap-submenu requires jQuery");!function(a){function b(b){var c=":not(.disabled, .divider, .dropdown-header):first";this.$element=a(b),this.$menu=this.$element.parent(),this.$menus=this.$menu.siblings(".dropdown-submenu"),this.$children=this.$menu.find("> .dropdown-menu > .dropdown-submenu"),this.$prev=this.$menu.prevAll(c).children("a"),this.$next=this.$menu.nextAll(c).children("a"),this.init()}b.prototype={init:function(){this.$element.on("click.bs.dropdown",this.click.bind(this)),this.$element.keydown(this.keydown.bind(this)),this.$menu.on("hide.bs.submenu",this.hide.bind(this))},click:function(a){a.stopPropagation(),this.toggle()},toggle:function(){this.$menu.hasClass("open")?this.close():(this.$menu.addClass("open"),this.$menus.trigger("hide.bs.submenu"))},hide:function(a){a.stopPropagation(),this.close()},close:function(){this.$menu.removeClass("open"),this.$children.trigger("hide.bs.submenu")},keydown:function(a){/^(32|38|40)$/.test(a.keyCode)&&a.preventDefault(),/^(13|32)$/.test(a.keyCode)?this.toggle():/^(38|40)$/.test(a.keyCode)&&(a.stopPropagation(),38==a.keyCode?this.$prev.focus():40==a.keyCode&&this.$next.focus())}},a.fn.submenupicker=function(){return this.each(function(){var c=a.data(this,"bs.submenu");c||(new b(this),a.data(this,"bs.submenu",!0))})}}(jQuery); |
@@ -13,3 +13,4 @@ 'use strict'; | ||
this.$menu = this.$element.parent(); | ||
this.$submenus = this.$menu.parent().find('.dropdown-submenu').not(this.$menu); | ||
this.$menus = this.$menu.siblings('.dropdown-submenu'); | ||
this.$children = this.$menu.find('> .dropdown-menu > .dropdown-submenu'); | ||
this.$prev = this.$menu.prevAll(desc).children('a'); | ||
@@ -25,2 +26,3 @@ this.$next = this.$menu.nextAll(desc).children('a'); | ||
this.$element.keydown(this.keydown.bind(this)); | ||
this.$menu.on('hide.bs.submenu', this.hide.bind(this)); | ||
}, | ||
@@ -33,5 +35,20 @@ click: function(event) { | ||
toggle: function() { | ||
this.$menu.toggleClass('open'); | ||
this.$submenus.removeClass('open'); | ||
if (this.$menu.hasClass('open')) { | ||
this.close(); | ||
} | ||
else { | ||
this.$menu.addClass('open'); | ||
this.$menus.trigger('hide.bs.submenu'); | ||
} | ||
}, | ||
hide: function(event) { | ||
// Stop event bubbling | ||
event.stopPropagation(); | ||
this.close(); | ||
}, | ||
close: function() { | ||
this.$menu.removeClass('open'); | ||
this.$children.trigger('hide.bs.submenu'); | ||
}, | ||
keydown: function(event) { | ||
@@ -38,0 +55,0 @@ // 13: Return, 32: Spacebar |
{ | ||
"name": "bootstrap-submenu", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "Bootstrap Sub-Menus", | ||
@@ -11,5 +11,5 @@ "keywords": [ | ||
"homepage": "http://vsn4ik.github.io/bootstrap-submenu", | ||
"author": "vsn4ik", | ||
"scripts": { | ||
"test": "grunt" | ||
"author": { | ||
"name": "Vasily A.", | ||
"url": "https://github.com/vsn4ik" | ||
}, | ||
@@ -27,7 +27,12 @@ "repository": { | ||
}, | ||
"scripts": { | ||
"test": "grunt" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.5", | ||
"grunt-banner": "~0.2.3", | ||
"grunt-cli": "~0.1.13", | ||
"grunt-contrib-clean": "~0.6.0", | ||
"grunt-contrib-copy": "~0.5.0", | ||
"grunt-contrib-cssmin": "~0.10.0", | ||
"grunt-contrib-less": "~0.11.4", | ||
@@ -34,0 +39,0 @@ "grunt-contrib-uglify": "~0.5.1", |
@@ -12,7 +12,8 @@ # [Bootstrap-submenu](http://vsn4ik.github.io/bootstrap-submenu) | ||
Three quick start options are available: | ||
Four quick start options are available: | ||
- [Download the latest release](https://github.com/vsn4ik/bootstrap-submenu/zipball/master "Download Bootstrap-submenu"). | ||
- [Download](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`. | ||
- Install with [NPM](https://www.npmjs.org): `npm install bootstrap-submenu`. | ||
@@ -31,12 +32,2 @@ | ||
## Browser Support | ||
- Google Chrome | ||
- Mozilla Firefox 14+ | ||
- Opera 11+ | ||
- Apple Safari 4+ | ||
- Internet Explorer 7/8 (used with jQuery 1.x) | ||
- Internet Explorer 9+ | ||
## Creators | ||
@@ -43,0 +34,0 @@ |
Sorry, the diff of this file is not supported yet
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
20215
12
254
9
43