From bd474e9761d67e89314c640412872f5c501caa09 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 2 Apr 2019 07:47:40 -0700 Subject: [PATCH] GUACAMOLE-723: Allow mouse interaction with the contents of a menu without closing the menu. --- .../webapp/app/navigation/directives/guacMenu.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/guacamole/src/main/webapp/app/navigation/directives/guacMenu.js b/guacamole/src/main/webapp/app/navigation/directives/guacMenu.js index e00cc1c4f..92e2c6c6d 100644 --- a/guacamole/src/main/webapp/app/navigation/directives/guacMenu.js +++ b/guacamole/src/main/webapp/app/navigation/directives/guacMenu.js @@ -52,6 +52,14 @@ angular.module('navigation').directive('guacMenu', [function guacMenu() { */ var element = $element[0]; + /** + * The element containing the menu contents that display when the + * menu is open. + * + * @type Element + */ + var contents = $element.find('.menu-contents')[0]; + /** * The main document object. * @@ -85,6 +93,11 @@ angular.module('navigation').directive('guacMenu', [function guacMenu() { e.stopPropagation(); }, false); + // Prevent click within menu contents from toggling menu visibility + contents.addEventListener('click', function clickInsideMenuContents(e) { + e.stopPropagation(); + }, false); + }] // end controller };