MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1,357: | Line 1,357: | ||
} | } | ||
function hideMobileTitle() { | |||
$('#firstHeading').hide(); | var $heading = $('#firstHeading'); | ||
if (!$heading.length) { | |||
return; | |||
} | |||
var headingText = $.trim($heading.text()); | |||
// Only subpages | |||
if (headingText.indexOf('/') === -1) { | |||
$heading.show(); | |||
return; | |||
} | |||
// Breadcrumb = first link immediately after page-heading | |||
var $breadcrumb = $('.page-heading') | |||
.parent() | |||
.children('p') | |||
.first() | |||
.find('a'); | |||
if ($breadcrumb.length) { | |||
$heading.hide(); | |||
} | |||
} | } | ||
hideMobileTitle(); | |||
setTimeout(hideMobileTitle, 500); | |||
setTimeout(hideMobileTitle, 1500); | |||
}); | }); | ||