- Werbung nur für Gäste -
");
}
}
// Change the class and localstorage when the toggle is clicked
$('.focus-editor-panel[data-setting]').on('click', function(){
var settingName = $(this).attr('data-setting');
var settingStatus = $(this).attr('data-status');
if(settingStatus === '1'){
html.removeClass('enable--' + settingName);
localStorage.setItem(settingName, '0');
$(this).attr('data-status', '0');
} else {
html.addClass('enable--' + settingName);
localStorage.setItem(settingName, '1');
$(this).attr('data-status', '1');
}
});
// Dark/light mode button
var toggleThemeTooltip = getComputedStyle(document.documentElement).getPropertyValue('--lang--light-dark-mode').slice(1, -1);
$('[data-focus-toggle-theme] [data-ipsTooltip]').prop('title', toggleThemeTooltip);
$('[data-focus-toggle-theme]').on('click', function(e){
var focusThemeId = html.attr('data-focus-alt-theme');
if(focusThemeId){
e.preventDefault();
$("#focusAltThemeSubmit").val(focusThemeId);
$("#focusAltThemeSubmit").click();
}
});
// Make hover navigation work with touch devices
;(function(e,t,n,r){e.fn.doubleTapToGo=function(r){if(!("ontouchstart"in t)&&!navigator.msMaxTouchPoints&&!navigator.userAgent.toLowerCase().match(/windows phone os 7/i))return false;this.each(function(){var t=false;e(this).on("click",function(n){var r=e(this);if(r[0]!=t[0]){n.preventDefault();t=r}});e(n).on("click touchstart MSPointerDown",function(n){var r=true,i=e(n.target).parents();for(var s=0;s
ul > li:has(ul)').doubleTapToGo();
// Toggle class
$('[data-class]').on( "click", function(event) { event.preventDefault(); var classContent = $(this).attr('data-class'); var classModifiers = classContent.split(' '); var className = classModifiers[0]; var modifyClass = classModifiers[1]; if (classModifiers[2]){ var targetElement = classModifiers[2]; } else { var targetElement = 'html'; } if (modifyClass === 'add'){ $(targetElement).addClass(className); } else if (modifyClass === 'remove'){ $(targetElement).removeClass(className); } else { $(targetElement).toggleClass(className); } });
});
// More dropdown menu
function focusNavigation() { var navwidth = 0; var morewidth = $('.ipsNavBar_primary .focus-nav__more').outerWidth(true); $('.ipsNavBar_primary > ul > li:not(.focus-nav__more)').each(function() { navwidth += $(this).outerWidth( true ) + 2; }); var availablespace = $('.ipsNavBar_primary').outerWidth(true) - morewidth; if (availablespace > 0 && navwidth > availablespace) { var lastItem = $('.ipsNavBar_primary > ul > li:not(.focus-nav__more)').last(); lastItem.attr('data-width', lastItem.outerWidth(true)); lastItem.prependTo($('.ipsNavBar_primary .focus-nav__more > ul')); focusNavigation(); } else { var firstMoreElement = $('.ipsNavBar_primary li.focus-nav__more li').first(); if (navwidth + firstMoreElement.data('width') < availablespace) { firstMoreElement.insertBefore($('.ipsNavBar_primary .focus-nav__more')); } } if ($('.focus-nav__more li').length > 0) { $('.focus-nav__more').removeClass('focus-nav__more--hidden'); } else { $('.focus-nav__more').addClass('focus-nav__more--hidden'); } }
$(window).on('load',function(){ $(".ipsNavBar_primary").removeClass("ipsNavBar_primary--loading"); focusNavigation(); });
$(window).on('resize',function(){ focusNavigation(); });
$(document).ready(function(){
$('[data-setting="fluid"]').on('click', function(){
setTimeout(function(){
focusNavigation();
}, 10);
});
});
Recommended Posts
Forum
Regeln
Trophies.de-Team
Verstärkung gesucht
Hilfreiche Themen
Aktivitäten
Features