From: arai-a Date: Wed, 10 Jan 2018 16:53:16 +0000 (+0900) Subject: Bug 1429449 - Do not handle non-primary click on dropdown menu X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f7bad0e4cca15a01d6abd347eb7ae3754907399;p=thirdparty%2Fbugzilla.git Bug 1429449 - Do not handle non-primary click on dropdown menu --- diff --git a/js/dropdown.js b/js/dropdown.js index 58aa4fee2..fd71d0b6e 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -9,6 +9,10 @@ $(function() { 'use strict'; $(window).click(function(e) { + // Do not handle non-primary click. + if (e.button != 0) { + return; + } // clicking dropdown button opens or closes the dropdown content if (!$(e.target).hasClass('dropdown-button')) { $('.dropdown-button').each(function() { @@ -100,6 +104,10 @@ $(function() { var $button = $div.find('.dropdown-button'); var $content = $div.find('.dropdown-content'); $button.click(function(e) { + // Do not handle non-primary click. + if (e.button != 0) { + return; + } toggleDropDown(e, $button, $content); }).keydown(function(e) { if (e.keyCode == 13) {