Matmarex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/58684


Change subject: jquery.makeCollapsible: minor fixes to togglingHandler()
......................................................................

jquery.makeCollapsible: minor fixes to togglingHandler()

Documentation was not consistent with the code.

Followup to Id3f457a8, per post-merge code review.

Change-Id: If64b685cf697620e3b6fef797767c947f2c1f512
---
M resources/jquery/jquery.makeCollapsible.js
1 file changed, 10 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/58684/1

diff --git a/resources/jquery/jquery.makeCollapsible.js 
b/resources/jquery/jquery.makeCollapsible.js
index f07f1b7..09fe06e 100644
--- a/resources/jquery/jquery.makeCollapsible.js
+++ b/resources/jquery/jquery.makeCollapsible.js
@@ -150,16 +150,20 @@
         * @param {jQuery.Event|null} e either the event or null if unavailable
         * @param {Object|undefined} options
         */
-       function togglingHandler( $toggle, $collapsible, event, options ) {
+       function togglingHandler( $toggle, $collapsible, e, options ) {
                var wasCollapsed, $textContainer, collapseText, expandText;
 
-               if ( event ) {
+               if ( options === undefined ) {
+                       options = {};
+               }
+
+               if ( e ) {
                        // Don't fire if a link was clicked, if requested  (for 
premade togglers by default)
-                       if ( options.linksPassthru && $.nodeName( event.target, 
'a' ) ) {
-                               return true;
+                       if ( options.linksPassthru && $.nodeName( e.target, 'a' 
) ) {
+                               return;
                        } else {
-                               event.preventDefault();
-                               event.stopPropagation();
+                               e.preventDefault();
+                               e.stopPropagation();
                        }
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/58684
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If64b685cf697620e3b6fef797767c947f2c1f512
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to