1function activateParentMenu(e,type) { 2 if(type == 'element') { 3 $(e).parents('.adtm_column').children('h5').children('a').addClass('advtm_menu_actif'); 4 $(e).parents('.li-niveau1').children('a').addClass('advtm_menu_actif'); 5 } 6 if(type == 'column') { 7 $(e).parents('.li-niveau1').children('a').addClass('advtm_menu_actif'); 8 } 9} 10 11function adtm_isMobileDevice() { 12 return (('ontouchstart' in window) || (typeof(document.documentElement) != 'undefined' && 'ontouchstart' in document.documentElement) || (typeof(window.navigator) != 'undefined' && typeof(window.navigator.msMaxTouchPoints) != 'undefined' && window.navigator.msMaxTouchPoints)); 13} 14 15function adtm_loadDoubleTap(){!function(e){e.event.special.doubletap={bindType:"touchend",delegateType:"touchend",handle:function(e){var a=e.handleObj,t=jQuery.data(e.target),n=(new Date).getTime(),l=t.lastTouch?n-t.lastTouch:0,u=null==u?300:u;u>l&&l>50?(t.lastTouch=null,e.type=a.origType,["clientX","clientY","pageX","pageY"].forEach(function(a){e[a]=e.originalEvent.changedTouches[0][a]}),a.handler.apply(this,arguments)):t.lastTouch=n}}}(jQuery)} 16 17$(document).ready(function(){ 18 if (adtm_isMobileDevice()) { 19 $("#adtm_menu").addClass('adtm_touch'); 20 adtm_loadDoubleTap(); 21 } 22 23 // Touch devices 24 $("#adtm_menu.adtm_touch ul#menu li.li-niveau1").each(function(){ 25 var li = $(this); 26 li.mouseover(function(){ li.data('hoverTime', new Date().getTime()); }); 27 if (typeof(li.mouseleave) != 'undefined') { 28 li.mouseleave(function(){ li.removeClass("adtm_is_open"); }); 29 } else if (typeof(li.mouseout) != 'undefined') { 30 li.mouseout(function(){ li.removeClass("adtm_is_open"); }); 31 } 32 li.children('a').bind('click', function() { 33 if (li.hasClass('sub') && !$('#adtm_menu').hasClass('adtm_menu_toggle_open')) { 34 return ( new Date().getTime() - li.data('hoverTime') ) > 1000; 35 } else if (li.hasClass('sub')) { 36 $(li).toggleClass('adtm_sub_open'); 37 $('div.adtm_sub', li).toggleClass('adtm_submenu_toggle_open'); 38 return false; 39 } 40 }); 41 li.children('a').bind('doubletap', function(e) { 42 if (li.hasClass('sub') && $(this).attr('href') != '' && $(this).attr('href') != '#') 43 window.location = $(this).attr('href'); 44 return false; 45 }); 46 }); 47 48 // Non-touch devices 49 $("#adtm_menu:not(.adtm_touch) ul#menu li.li-niveau1").each(function(){ 50 var li = $(this); 51 if (li.hasClass('sub')) { 52 li.children('a').click(function(e) { 53 if ($('#adtm_menu:not(.adtm_touch) ul#menu li.advtm_menu_toggle').is(':visible')) { 54 $(li).toggleClass('adtm_sub_open'); 55 $('div.adtm_sub', li).toggleClass('adtm_submenu_toggle_open'); 56 return false; 57 } 58 }); 59 li.children('a').bind('dblclick', function(e) { 60 if ($('#adtm_menu:not(.adtm_touch) ul#menu li.advtm_menu_toggle').is(':visible')) { 61 if ($('#adtm_menu').hasClass('adtm_menu_toggle_open') && li.hasClass('sub') && $(this).attr('href') != '' && $(this).attr('href') != '#') 62 window.location = $(this).attr('href'); 63 return false; 64 } 65 }); 66 } 67 }); 68 69 // Set event for menu toggle 70 $('#adtm_menu ul li.advtm_menu_toggle a.adtm_toggle_menu_button').unbind('click').bind('click', function(e) { 71 $('#adtm_menu').toggleClass('adtm_menu_toggle_open'); 72 return false; 73 }); 74});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.