From f53de5469b709cb750fcaec095ba068492dfac9e Mon Sep 17 00:00:00 2001 From: "This, that and the other" Date: Sat, 2 Jan 2016 02:25:23 +1100 Subject: [PATCH] Fix the cancel event function to prevent erroneous close Changed the conditions for the cancel event function so that the ULS popup does not close when a descendant element of the trigger is clicked. Was erroneously merged to gerrit as https://gerrit.wikimedia.org/r/#/c/261810/, I forgot that this was an upstream library. https://phabricator.wikimedia.org/T122722 --- src/jquery.uls.core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery.uls.core.js b/src/jquery.uls.core.js index 529b47a..76a69c6 100644 --- a/src/jquery.uls.core.js +++ b/src/jquery.uls.core.js @@ -319,7 +319,7 @@ * On cancel handler for the uls menu */ cancel: function ( e ) { - if ( e && this.$element.is( e.target ) ) { + if ( e && ( this.$element.is( e.target ) || $.contains( this.$element[0], e.target ) ) ) { return; }