import contao demo theme open sauce (1.5.18)
This commit is contained in:
1 parent
37c03164ea
commit
942dd631ee
64 files changed
+16532
-2
No files matched your search
@@ -0,0 +1,35 @@
|
||||
// must be loaded at the end of the body element
|
||||
(function(){
|
||||
var addEvent = function(element, event, func){
|
||||
if(element.addEventListener){
|
||||
element.addEventListener(event, func, false);
|
||||
}
|
||||
else{
|
||||
element.attachEvent('on'+event, func);
|
||||
}
|
||||
},
|
||||
eventPreventDefault = function(event){
|
||||
event = event || window.event;
|
||||
if(event.preventDefault){
|
||||
event.preventDefault();
|
||||
}
|
||||
else{
|
||||
event.returnValue = false;
|
||||
}
|
||||
},
|
||||
navMainMobile = document.getElementById('main-navigation-mobile');
|
||||
if(navMainMobile){
|
||||
addEvent(navMainMobile, 'change', function(){
|
||||
// Bugfix for IE to follow the base tag correctly
|
||||
var link = document.createElement('a');
|
||||
link.href = navMainMobile.value;
|
||||
document.location.href = ''+link.href;
|
||||
});
|
||||
if (navMainMobile.querySelector && !navMainMobile.querySelector('option[selected]')) {
|
||||
var activeOptions = navMainMobile.querySelectorAll('option.active,option.trail');
|
||||
if (activeOptions.length) {
|
||||
activeOptions[activeOptions.length - 1].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
Reference in new issue
Block a user