Avoid JavaScript errors for tipsy if no entry point on the page
Bug: T278313 Change-Id: I48011eec9f7d876b914550012cc76e2209fc783c
This commit is contained in:
committed by
jenkins-bot
parent
51ec3bc0e6
commit
50b345c83d
@@ -125,6 +125,17 @@
|
||||
$( '.uls-settings-trigger, .mw-interlanguage-selector' ) :
|
||||
$( '.uls-trigger' );
|
||||
|
||||
// Fallback if no entry point is present
|
||||
if ( !$ulsTrigger.length ) {
|
||||
$ulsTrigger = $( '#pt-preferences' );
|
||||
}
|
||||
|
||||
// Skip tooltip if there is no element to attach the tooltip to.
|
||||
// It will cause errors otherwise.
|
||||
if ( !$ulsTrigger.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
function hideTipsy() {
|
||||
ulsPopup.toggle( false );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user