From 6f7bad0e4cca15a01d6abd347eb7ae3754907399 Mon Sep 17 00:00:00 2001 From: arai-a Date: Thu, 11 Jan 2018 01:53:16 +0900 Subject: Bug 1429449 - Do not handle non-primary click on dropdown menu --- js/dropdown.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js') 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) { -- cgit v1.2.3-24-g4f1b