Support Us Login
'); subMenuHolder = jQuery(".bn-sub-navigation #submenu-" + submenuId); var data = testData[submenuId], hasMain = (typeof data.mainFilters != "undefined" && data.mainFilters.length > 0), hasMore = (typeof data.moreFilters != "undefined" && data.moreFilters.length > 0), hasTrailers = (typeof data.trailers != "undefined" && data.trailers.length > 0); // main filters empty if(!hasMain) return; // TPL var tpl = '', createLink = function(lable, url){ return '' + lable + ''; }, createTrailer = function(trailer){ return '
' + '
' + '
' + '' + '' + '' + '
' + '
' + '' + trailer.text + '' + '
' + '
' + '
'; }, createBanner = function(targeting){ var tg = (targeting) ? 'data-targeting=\'' + JSON.stringify(targeting) + '\'' : ''; var banner_html = '
' + '
' + '
'; banner_html += '
'; return banner_html; }, createMain = function(){ if(!hasMain) return ''; var result = '
'; // create filter list result += '
'; for(var i in data.mainFilters) { if(!data.mainFilters.hasOwnProperty(i)) continue; var item = data.mainFilters[i]; if(item.is_visible == 1){ result += createLink(item.label, item.url,item.is_visible); } } if(hasMore) result += 'more'; result += '
'; // end filter list // create trailers if(hasTrailers) { for(var i1 in data.trailers) { if(!data.trailers.hasOwnProperty(i1)) continue; if(i1 == 2) { result += createBanner(data.targeting); } var trailer = data.trailers[i1]; result += createTrailer(trailer); } } // end trailers result += '
'; result += '
'; return result; }, createExtra = function(){ if(!hasMore) return ''; var result = '
'; for(var i in data.moreFilters) { if(!data.moreFilters.hasOwnProperty(i)) continue; var item = data.moreFilters[i]; if(item.is_visible == 1) { result += createLink(item.label, item.url); } } result += '
'; result += '
'; return result; }; tpl += createMain(); if(hasMore) tpl += createExtra(); subMenuHolder.html(tpl); // more button jQuery("#submenu-" + submenuId + " .sub-more").on('click', function() { var t = jQuery(this); var extra = jQuery('#submenu-' + submenuId + ' .sub-col-extra'); t.toggleClass('active'); extra.toggleClass('active'); return false; }); } jQuery('.bn-sub-navigation #submenu-' + submenuId + ' .sub-col-extra').removeClass('active'); jQuery('.bn-sub-navigation #submenu-' + submenuId + ' .sub-more').removeClass('active'); subMenu.show(); subMenuHolder.show(); }; window.updateSubMenuPosition = function(){ mainMenuEndPoint = topNav.position(); mainMenuHeight = topNav.outerHeight(); subMenu.css('position', 'absolute'); subMenu.css('top', mainMenuEndPoint.top + mainMenuHeight); }; //init scroll control var locationPath = document.location.pathname.split('/'); if(locationPath[1] != 'admin') { var block = jQuery('#one-line-nav-block'), navBar = jQuery('#nav-bar'), navLoginButtons = jQuery('#nav-login-buttons'), searchBar = jQuery('.top-nav .search-bar'), scrollPosition = jQuery(window).scrollTop(), windowWidth = jQuery(window).width(), topNav = jQuery(".top-nav"), subMenu = jQuery(".bn-sub-navigation"), subMenuIsDev = false, timeoutHideMenuTime = 300, timeoutHideMenu; block.find('.centered').append(navBar.clone()); block.find('.one-line-nav').append(navLoginButtons.clone()); block.find('.one-line-nav').append(searchBar.clone()); // // sub menu // var mainMenuEndPoint = topNav.position(), mainMenuHeight = topNav.outerHeight(); // subMenu.css('position', 'absolute'); // subMenu.css('top', mainMenuEndPoint.top + mainMenuHeight); window.updateSubMenuPosition(); if(subMenuIsDev) subMenu.addClass('active'); // add arrows jQuery('.with-submenu').append(''); if(windowWidth > 1024) { var openedSubMenuId; jQuery('.b-nav-new a[data-submenu]').hover(function(){ clearTimeout(timeoutHideMenu); var t = jQuery(this), subMenuId = t.data('submenu'); // createSubMenu generateSubmenu(subMenuId); if(t.parents('.one-line-nav').length === 0) window.updateSubMenuPosition(); jQuery('.b-nav-new a[data-submenu=' + openedSubMenuId + ']').removeClass('opened'); openedSubMenuId = subMenuId; jQuery('.b-nav-new a[data-submenu=' + openedSubMenuId + ']').addClass('opened'); subMenu.addClass('active'); // window.updateSubMenuPosition(); if(typeof window.bannerClass !== 'undefined') window.bannerClass.findAndInit(); }, function(){ timeoutHideMenu = setTimeout(function(){ if(!subMenuIsDev) { subMenu.removeClass('active'); subMenu.hide(); jQuery('.b-nav-new a[data-submenu=' + openedSubMenuId + ']').removeClass('opened'); } },timeoutHideMenuTime); }); subMenu.hover(function(){ clearTimeout(timeoutHideMenu); },function(){ timeoutHideMenu = setTimeout(function(){ if(!subMenuIsDev) { subMenu.removeClass('active'); subMenu.hide(); jQuery('.b-nav-new a[data-submenu=' + openedSubMenuId + ']').removeClass('opened'); } },timeoutHideMenuTime); }); } // mobile submenu else { jQuery(document).on('click touchend', '.with-submenu .mobile-arrow', function(){ var t = jQuery(this), li = jQuery(t.parent()), nav = t.parents('.b-nav-new'); if(!li.hasClass('opened')) { var opened = jQuery('.with-submenu.opened', nav); if(opened.length > 0) { jQuery('.b-nav-new .nav-list li a.disabled').removeClass('disabled'); opened.removeClass('opened'); } li.addClass("opened"); jQuery('.b-nav-new .nav-list>li[class!="with-submenu opened"] a[class!="mobile-arrow"]').addClass('disabled'); } else { jQuery('.b-nav-new .nav-list li a.disabled').removeClass('disabled'); li.removeClass('opened'); } return false; }); } // // end sub menu // scrollControl(windowWidth, scrollPosition, block, subMenu, topNav); jQuery(window).scroll(function () { var scrollPosition = jQuery(window).scrollTop(), windowWidth = jQuery(window).width(); scrollControl(windowWidth, scrollPosition, block, subMenu, topNav); }); jQuery(window).resize(function(){ var windowWidth = jQuery(window).width(); if(windowWidth < 1025) { if(block.hasClass("active")) { block.removeClass("active"); block.hide(); } if(subMenu.hasClass("active")) subMenu.removeClass("active"); } }); } }); jQuery(document).ready(function() { //notification display message // + set a localstorage to display only once //check if it is IOS or not var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform); if (iOS) { //hide the notification for IOS user SINCE it is still does not support Web push. jQuery("#notification-button-mobile").hide(); } if (Modernizr.localstorage) { var countNotification = localStorage.getItem('countNotification'); if (countNotification === null) { countNotification = 0; } if (countNotification <= 1 ){ setTimeout(function() { jQuery("#notification-button-mobile").attr('data-balloon-visible',''); setTimeout(function() { jQuery("#notification-button-mobile").removeAttr('data-balloon-visible'); }, 12000); },2000 ); setTimeout(function() { jQuery("#notification-button").attr('data-balloon-visible',''); setTimeout(function() { jQuery("#notification-button").removeAttr('data-balloon-visible'); }, 12000); },2000 ); } countNotification++; localStorage.setItem('countNotification',countNotification); } else { //Find a alternative solution maybe a Variable. // i dont provide support for notification for old browser though one solution is to use cookies but this would affect speed and this is a BETA test. } });
Get the Best of London Life, Culture and Style
By entering my email I agree to the CultureWhisper Privacy Policy (we won`t share data & you can unsubscribe anytime).
TV
From Lulu Wang's feministic character drama Expats starring Nicole Kidman to John Orloff's airborne WWII drama Masters of the Air with Austin Butler, this week's TV provides a starry selection