Changes

From The Bakugan Wiki

MediaWiki:Common.js

1,180 bytes removed, 00:31, 12 November 2018
no edit summary
/*
Tabber fix from GBF Wiki
*/
function checkExist(selector, cb) {
var i = 0;
var handler = setInterval(function() {
i += 1;
if (i > 4) clearInterval(handler);
if (document.querySelector(selector)) {
cb.call();
clearInterval(handler);
}
}, 1000);
}
checkExist('.tabbernav', function() {
$('div .tabbernav a').each( function() {
$(this).click( function(e) {
e.stopPropagation();
 
// https://github.com/HydraWiki/Tabber/blob/a499360d0d8081eed24bb8dfcbe3bc1e212e7301/js/tabber.js#L25
function showContent( title, tabber ) {
var tabContent = $(tabber).closest('.tabber').children('.tabbertab');
var nav = $(tabber).children('.tabbernav');
 
var content = tabContent.filter( '[title="' + title + '"]' );
if ( content.length !== 1 ) { return false; }
tabContent.hide();
content.show();
nav.find( '.tabberactive' ).removeClass( 'tabberactive' );
nav.find( 'a[title="' + title + '"]' ).parent().addClass( 'tabberactive' );
return true;
}
 
var tabber = $(this).closest('.tabber');
var title = $(this).attr('title');
showContent(title, tabber);
});
});
});
 
//
Mobile Tooltip Hover/Touch Fix
Prevent link from opening when you first tap a link with tooltip.
Tapping the link again opens the link.
/*/
(function () {
document.addEventListener("touchstart", function() {
725
edits