From 5f73ce2c776aac7104d241a2d29aa71351b6c01e Mon Sep 17 00:00:00 2001 From: tpinne Date: Thu, 28 May 2015 18:56:45 +0200 Subject: [PATCH] Update bootstrap-hover-dropdown.js With this little addition the plugin also respects the default dropdown behavior, if the toggle element is disabled --- bootstrap-hover-dropdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-hover-dropdown.js b/bootstrap-hover-dropdown.js index 28b38b5..74db4de 100644 --- a/bootstrap-hover-dropdown.js +++ b/bootstrap-hover-dropdown.js @@ -47,7 +47,7 @@ $parent.hover(function (event) { // so a neighbor can't open the dropdown - if(!$parent.hasClass('open') && !$this.is(event.target)) { + if(!$parent.hasClass('open') && !$this.is(event.target) || $this.is('.disabled, :disabled')) { // stop this event, stop executing any code // in this callback but continue to propagate return true; @@ -68,7 +68,7 @@ $this.hover(function (event) { // this helps prevent a double event from firing. // see https://github.com/CWSpear/bootstrap-hover-dropdown/issues/55 - if(!$parent.hasClass('open') && !$parent.is(event.target)) { + if(!$parent.hasClass('open') && !$parent.is(event.target) || $this.is('.disabled, :disabled')) { // stop this event, stop executing any code // in this callback but continue to propagate return true;