From 6a367e3fb78a532f8f10448b51e1fc9777991b82 Mon Sep 17 00:00:00 2001 From: vsn4ik Date: Tue, 26 Aug 2014 18:16:08 +0400 Subject: [PATCH] Bump v1.1.2. Fix keydown func. --- bower.json | 2 +- dist/css/bootstrap-submenu.css | 2 +- dist/css/bootstrap-submenu.min.css | 2 +- dist/js/bootstrap-submenu.js | 9 ++++++--- dist/js/bootstrap-submenu.min.js | 4 ++-- docs/_includes/header.html | 6 +++++- docs/dist/css/bootstrap-submenu.css | 2 +- docs/dist/css/bootstrap-submenu.min.css | 2 +- docs/dist/js/bootstrap-submenu.js | 9 ++++++--- docs/dist/js/bootstrap-submenu.min.js | 4 ++-- js/bootstrap-submenu.js | 7 +++++-- package.json | 2 +- 12 files changed, 32 insertions(+), 19 deletions(-) diff --git a/bower.json b/bower.json index a0a8543..3036b32 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "bootstrap-submenu", - "version": "1.1.1", + "version": "1.1.2", "authors": [ "vsn4ik" ], diff --git a/dist/css/bootstrap-submenu.css b/dist/css/bootstrap-submenu.css index 75f6cb1..0a82bfb 100644 --- a/dist/css/bootstrap-submenu.css +++ b/dist/css/bootstrap-submenu.css @@ -1,5 +1,5 @@ /*! - * Bootstrap-submenu v1.1.1 (http://vsn4ik.github.io/bootstrap-submenu) + * Bootstrap-submenu v1.1.2 (http://vsn4ik.github.io/bootstrap-submenu) * Copyright 2014 vsn4ik * Licensed under MIT (https://github.com/vsn4ik/bootstrap-submenu/blob/master/LICENSE) */ diff --git a/dist/css/bootstrap-submenu.min.css b/dist/css/bootstrap-submenu.min.css index eb59510..636c6a5 100644 --- a/dist/css/bootstrap-submenu.min.css +++ b/dist/css/bootstrap-submenu.min.css @@ -1,5 +1,5 @@ /*! - * Bootstrap-submenu v1.1.1 (http://vsn4ik.github.io/bootstrap-submenu) + * Bootstrap-submenu v1.1.2 (http://vsn4ik.github.io/bootstrap-submenu) * Copyright 2014 vsn4ik * Licensed under MIT (https://github.com/vsn4ik/bootstrap-submenu/blob/master/LICENSE) */ diff --git a/dist/js/bootstrap-submenu.js b/dist/js/bootstrap-submenu.js index f02cab1..b9bdc40 100644 --- a/dist/js/bootstrap-submenu.js +++ b/dist/js/bootstrap-submenu.js @@ -1,5 +1,5 @@ /*! - * Bootstrap-submenu v1.1.1 (http://vsn4ik.github.io/bootstrap-submenu) + * Bootstrap-submenu v1.1.2 (http://vsn4ik.github.io/bootstrap-submenu) * Copyright 2014 vsn4ik * Licensed under MIT (https://github.com/vsn4ik/bootstrap-submenu/blob/master/LICENSE) */ @@ -21,12 +21,15 @@ if (typeof jQuery === 'undefined') { Submenupicker.prototype = { init: function() { - this.$element.on('click.bs.dropdown', this.toggle.bind(this)); + this.$element.on('click.bs.dropdown', this.click.bind(this)); this.$menu.keydown(this.keydown.bind(this)); }, - toggle: function(event) { + click: function(event) { event.stopPropagation(); + this.toggle(); + }, + toggle: function() { var isActive = this.$menu.hasClass('open'); this.$submenus.removeClass('open'); diff --git a/dist/js/bootstrap-submenu.min.js b/dist/js/bootstrap-submenu.min.js index 5020c04..a8c62de 100644 --- a/dist/js/bootstrap-submenu.min.js +++ b/dist/js/bootstrap-submenu.min.js @@ -1,7 +1,7 @@ /*! - * Bootstrap-submenu v1.1.1 (http://vsn4ik.github.io/bootstrap-submenu) + * Bootstrap-submenu v1.1.2 (http://vsn4ik.github.io/bootstrap-submenu) * Copyright 2014 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){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(a){a.stopPropagation();var b=this.$menu.hasClass("open");this.$submenus.removeClass("open"),b||this.$menu.addClass("open")},keydown:function(a){32==a.keyCode&&a.preventDefault(),/^(13|32)$/.test(a.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); \ No newline at end of file +"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.click.bind(this)),this.$menu.keydown(this.keydown.bind(this))},click:function(a){a.stopPropagation(),this.toggle()},toggle:function(){var a=this.$menu.hasClass("open");this.$submenus.removeClass("open"),a||this.$menu.addClass("open")},keydown:function(a){32==a.keyCode&&a.preventDefault(),/^(13|32)$/.test(a.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); \ No newline at end of file diff --git a/docs/_includes/header.html b/docs/_includes/header.html index 588188d..0e96674 100644 --- a/docs/_includes/header.html +++ b/docs/_includes/header.html @@ -1,3 +1,7 @@ + + + + @@ -13,5 +17,5 @@ - + diff --git a/docs/dist/css/bootstrap-submenu.css b/docs/dist/css/bootstrap-submenu.css index 75f6cb1..0a82bfb 100644 --- a/docs/dist/css/bootstrap-submenu.css +++ b/docs/dist/css/bootstrap-submenu.css @@ -1,5 +1,5 @@ /*! - * Bootstrap-submenu v1.1.1 (http://vsn4ik.github.io/bootstrap-submenu) + * Bootstrap-submenu v1.1.2 (http://vsn4ik.github.io/bootstrap-submenu) * Copyright 2014 vsn4ik * Licensed under MIT (https://github.com/vsn4ik/bootstrap-submenu/blob/master/LICENSE) */ diff --git a/docs/dist/css/bootstrap-submenu.min.css b/docs/dist/css/bootstrap-submenu.min.css index eb59510..636c6a5 100644 --- a/docs/dist/css/bootstrap-submenu.min.css +++ b/docs/dist/css/bootstrap-submenu.min.css @@ -1,5 +1,5 @@ /*! - * Bootstrap-submenu v1.1.1 (http://vsn4ik.github.io/bootstrap-submenu) + * Bootstrap-submenu v1.1.2 (http://vsn4ik.github.io/bootstrap-submenu) * Copyright 2014 vsn4ik * Licensed under MIT (https://github.com/vsn4ik/bootstrap-submenu/blob/master/LICENSE) */ diff --git a/docs/dist/js/bootstrap-submenu.js b/docs/dist/js/bootstrap-submenu.js index f02cab1..b9bdc40 100644 --- a/docs/dist/js/bootstrap-submenu.js +++ b/docs/dist/js/bootstrap-submenu.js @@ -1,5 +1,5 @@ /*! - * Bootstrap-submenu v1.1.1 (http://vsn4ik.github.io/bootstrap-submenu) + * Bootstrap-submenu v1.1.2 (http://vsn4ik.github.io/bootstrap-submenu) * Copyright 2014 vsn4ik * Licensed under MIT (https://github.com/vsn4ik/bootstrap-submenu/blob/master/LICENSE) */ @@ -21,12 +21,15 @@ if (typeof jQuery === 'undefined') { Submenupicker.prototype = { init: function() { - this.$element.on('click.bs.dropdown', this.toggle.bind(this)); + this.$element.on('click.bs.dropdown', this.click.bind(this)); this.$menu.keydown(this.keydown.bind(this)); }, - toggle: function(event) { + click: function(event) { event.stopPropagation(); + this.toggle(); + }, + toggle: function() { var isActive = this.$menu.hasClass('open'); this.$submenus.removeClass('open'); diff --git a/docs/dist/js/bootstrap-submenu.min.js b/docs/dist/js/bootstrap-submenu.min.js index 5020c04..a8c62de 100644 --- a/docs/dist/js/bootstrap-submenu.min.js +++ b/docs/dist/js/bootstrap-submenu.min.js @@ -1,7 +1,7 @@ /*! - * Bootstrap-submenu v1.1.1 (http://vsn4ik.github.io/bootstrap-submenu) + * Bootstrap-submenu v1.1.2 (http://vsn4ik.github.io/bootstrap-submenu) * Copyright 2014 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){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(a){a.stopPropagation();var b=this.$menu.hasClass("open");this.$submenus.removeClass("open"),b||this.$menu.addClass("open")},keydown:function(a){32==a.keyCode&&a.preventDefault(),/^(13|32)$/.test(a.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); \ No newline at end of file +"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.click.bind(this)),this.$menu.keydown(this.keydown.bind(this))},click:function(a){a.stopPropagation(),this.toggle()},toggle:function(){var a=this.$menu.hasClass("open");this.$submenus.removeClass("open"),a||this.$menu.addClass("open")},keydown:function(a){32==a.keyCode&&a.preventDefault(),/^(13|32)$/.test(a.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); \ No newline at end of file diff --git a/js/bootstrap-submenu.js b/js/bootstrap-submenu.js index 0e1a784..44677ec 100644 --- a/js/bootstrap-submenu.js +++ b/js/bootstrap-submenu.js @@ -15,12 +15,15 @@ if (typeof jQuery === 'undefined') { Submenupicker.prototype = { init: function() { - this.$element.on('click.bs.dropdown', this.toggle.bind(this)); + this.$element.on('click.bs.dropdown', this.click.bind(this)); this.$menu.keydown(this.keydown.bind(this)); }, - toggle: function(event) { + click: function(event) { event.stopPropagation(); + this.toggle(); + }, + toggle: function() { var isActive = this.$menu.hasClass('open'); this.$submenus.removeClass('open'); diff --git a/package.json b/package.json index c094ef4..c9901db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-submenu", - "version": "1.1.1", + "version": "1.1.2", "description": "Bootstrap Sub-Menus", "keywords": [ "bootstrap",