Merge "Make collapsible code more resilient"

This commit is contained in:
jenkins-bot 2020-07-20 22:08:07 +00:00 committed by Gerrit Code Review
commit d09649250d
1 changed files with 7 additions and 1 deletions

View File

@ -71,7 +71,13 @@ function init() {
$.collapsibleTabs.addData( $collapsible );
settings = $collapsible.data( 'collapsibleTabsSettings' );
}
return settings;
// it's possible for getSettings to return undefined
// if no data attributes have been set
// see T177108#6310908.
// In particular, a gadget may have added a collapsible link to the list:
// e.g.
// $('<li class="collapsible">my link</a>').appendTo( $('#p-cactions ul') )
return settings || {};
},
handleResize: function () {
$.collapsibleTabs.instances.forEach( function ( $el ) {