Kemi Badenoch brands Robert Jenrick supporters seeking to oust her 'sore losers'

Tory MP dodges question on whether Robert Jenrick would do a better job than Kemi Badenoch |

GB NEWS

GB News

By GB News


Published: 03/09/2025

- 03:42

The Tory leader labelled Nigel Farage as a 'bulls*** artist'

Kemi Badenoch has branded Robert Jenrick's supporters "sore losers" after backing him to replace her as Conservative leader.

She suggested that some of her critics believed she only got the role because of positive discrimination, saying they "can't cope with the fact that I won this".


Mrs Badenoch defeated Mr Jenrick in last year's leadership contest, which the latter claimed Mr Jenrick found "distressing".

**ARE YOU READING THIS ON OUR APP? DOWNLOAD NOW FOR THE BEST GB NEWS EXPERIENCE**

She said it was "wishful thinking" that Mr Jenrick could replace her as Tory leader.

Mrs Badenoch told The Sunday Times: "There will always be people who are sore losers, our candidate didn't win and so on, and sour grapes. When I hear those things, I can tell those people are not focused on the country at all.

"Many of those people having those conversations think this is a game. But the lives of people in this country aren't a game.

"I think even Rob himself finds it distressing, but it's just something that we deal with."

LATEST DEVELOPMENTS

Kemi Badenoch

Mrs Badenoch has hit out at Mr Jenrick's supporters

|
PA

The Tory leader said that some of the criticism aimed at her was "about my race and my ethnicity", with individuals claiming she was a diversity, equity and inclusion (DEI) hire.

Mrs Badenoch said: "There's a certain cadre of people who clearly can't cope with the fact that I won this and I'm doing it. The level of personal attacks from anonymous people, it's hysterical.

"Not even just from MPs. I actually don't think there are that many MPs. I think it's two to three people out of 120. That's nothing. But online as well.

"People used to talk about Trump derangement syndrome. I think there's a Kemi derangement syndrome – 'How could she possibly have done this? It must have been DEI'."

The Tory leader has so far been unable to recover Tory failings, with the party falling behind Labour and Reform UK in the opinion polls.

Mrs Badenoch explained that people are "angry because of things that Labour is doing" and "they are angry because they think that we left the country in a bad state".

She stated her task was tougher than that faced by William Hague after the 1997 Labour landslide: "We've got fewer MPs, and we've got this new problem with Reform taking a lot of our votes."

The Tory leader also took aim at Nigel Farage, describing him as a "bulls*** artist".

Robert Jenrick

Robert Jenrick is tipped to be the next Tory leader

|
PA

She said that Reform UK was "just about pulling this down and destroying things", as she slammed her rival on the right.

According to YouGov, 28 per cent of the public would vote for Reform UK at the next general election.

This compares to Labour at 21 per cent and the Tories only on 18 per cent, some 10 per cent behind Farage's party.

The Tories popularity has steadily fallen as the year has gone on, with the party polling at 22 per cent of the voter share in January, four per cent up to August.

More From GB News
}); window.REBELMOUSE_TASKS_QUEUE.push(function(){ // // Scroll position for primary navigation // const isMobile = window.innerWidth <= 768; // let menuButtonSize = 0; // const menuButton = document.querySelector('.navbar .nav .sticky-left-click'); // if (menuButton) { // menuButtonSize = menuButton.getBoundingClientRect().width; // } // var doc_body = document.body; // var pri_nav = document.querySelector('.navbar .nav'); // // Checking active primary menu item and calculating left scroll for the navigation // if (isMobile) { // const activeMenuItem = document.querySelector('.navbar .nav .nav--item.active'); // if (activeMenuItem) { // const activeMenuItemLeftPosition = activeMenuItem.offsetLeft; // const navigation = document.querySelector('.navbar .nav'); // const navigationComputedStyles = window.getComputedStyle(navigation); // const marginLeft = parseInt(navigationComputedStyles.getPropertyValue('margin-left')); // pri_nav.scrollLeft = activeMenuItemLeftPosition - marginLeft - menuButtonSize; // } // } else if (window.sessionStorage.getItem("pri_nav_pos")) { // pri_nav.scrollLeft = window.sessionStorage.getItem("pri_nav_pos"); // } // // The logic for the secondary menu wasn't changed // if (window.sessionStorage.getItem("sec_nav_pos") && window.sessionStorage.getItem("sec_nav_wrap")) { // var scrolli__item = document.querySelector('.'+window.sessionStorage.getItem("sec_nav_wrap")+' .list'); // if (scrolli__item) { // scrolli__item.scrollLeft = window.sessionStorage.getItem("sec_nav_pos"); // } // } // var pri_nav_items = pri_nav.querySelectorAll('a'); // var sec_nav_items = document.querySelectorAll('.navbar .secondary--nav a'); // // Function to restore active navigation states after page reload // function restoreActiveNavigation() { // // Restore active primary nav item // const activePriNavItem = sessionStorage.getItem('active_pri_nav_item'); // if (activePriNavItem) { // const priElement = document.querySelector(`[data-pri-nav-id="${activePriNavItem}"]`); // if (priElement) { // // Remove active class from all primary nav items first // document.querySelectorAll('.navbar .nav .nav--item').forEach(el => { // el.classList.remove('active'); // }); // priElement.classList.add('active'); // console.log('Restored active class to primary nav:', priElement); // } // } // // Restore active secondary nav item // const activeSecNavItem = sessionStorage.getItem('active_sec_nav_item'); // if (activeSecNavItem) { // const secElement = document.querySelector(`[data-sec-nav-id="${activeSecNavItem}"]`); // if (secElement) { // // Remove active class from all secondary nav items first // document.querySelectorAll('.navbar .secondary--nav .list__item').forEach(el => { // el.classList.remove('active'); // }); // secElement.classList.add('active'); // console.log('Restored active class to secondary nav:', secElement); // } // } // } // // Add unique identifiers to navigation items // function initializeNavigationIds() { // // Add IDs to primary nav items // pri_nav_items.forEach(function(item, index) { // const navItem = item.closest('.nav--item'); // if (navItem && !navItem.hasAttribute('data-pri-nav-id')) { // navItem.setAttribute('data-pri-nav-id', `pri-nav-${index}`); // } // }); // // Add IDs to secondary nav items // sec_nav_items.forEach(function(item, index) { // if (!item.hasAttribute('data-sec-nav-id')) { // item.setAttribute('data-sec-nav-id', `sec-nav-${index}`); // } // }); // } // // Primary navigation click handlers // pri_nav_items.forEach(function(item) { // item.onclick = function(event) { // console.log('Primary nav clicked:', event.target); // const navItem = event.target.closest('.nav--item'); // if (navItem) { // // Remove active class from all primary nav items // document.querySelectorAll('.navbar .nav .nav--item').forEach(el => { // el.classList.remove('active'); // }); // // Add active class to clicked primary nav item // navItem.classList.add('active'); // // Save active primary nav item to sessionStorage // const priNavId = navItem.getAttribute('data-pri-nav-id'); // if (priNavId) { // sessionStorage.setItem('active_pri_nav_item', priNavId); // console.log('Saved active primary nav item:', priNavId); // } // // Clear secondary nav active state when primary nav changes // sessionStorage.removeItem('active_sec_nav_item'); // document.querySelectorAll('.navbar .secondary--nav .list__item').forEach(el => { // el.classList.remove('active'); // }); // } // // Original sessionStorage handling // sessionStorage.removeItem("pri_nav_pos"); // sessionStorage.removeItem("sec_nav_wrap"); // sessionStorage.removeItem("sec_nav_pos"); // window.sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); // } // }); // // Secondary navigation click handlers (your existing code with modifications) // sec_nav_items.forEach(function(item) { // item.onclick = function(event) { // const target = event.target; // // Remove active class from all secondary nav items in current menu // const currentSecondaryNav = target.closest('.secondary--nav'); // if (currentSecondaryNav) { // currentSecondaryNav.querySelectorAll('.list__item').forEach(el => { // el.classList.remove('active'); // }); // } // // Add active class to clicked secondary nav item // target.classList.add('active'); // // Save active secondary nav item to sessionStorage // const secNavId = target.getAttribute('data-sec-nav-id'); // if (secNavId) { // sessionStorage.setItem('active_sec_nav_item', secNavId); // } // // Reset primary nav active state (optional, depending on your logic) // document.querySelectorAll('.navbar .nav .nav--item').forEach(el => { // el.classList.remove('active'); // }); // sessionStorage.removeItem('active_pri_nav_item'); // // Store scroll positions // sessionStorage.removeItem("sec_nav_wrap"); // sessionStorage.removeItem("sec_nav_pos"); // const sec_nav_wrap = target.closest('.list'); // if (sec_nav_wrap) { // sessionStorage.setItem("sec_nav_pos", sec_nav_wrap.scrollLeft); // const navItem = sec_nav_wrap.closest('.nav--item'); // if (navItem && navItem.classList[1]) { // sessionStorage.setItem("sec_nav_wrap", navItem.classList[1]); // } // } // sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); // }; // }); // // Hover effects for nav items // document.querySelectorAll('.nav--item').forEach(function(item) { // var timeout = null; // var timeout2 = null; // // Uncomment if you want hover effects // // item.onmouseover = function() { // // timeout = setTimeout(function(){ // // item.classList.add('hover_active') // // }, 300); // // clearTimeout(timeout2); // // } // // item.onmouseout = function() { // // timeout2 = setTimeout(function(){ // // item.classList.remove('hover_active') // // }, 300); // // clearTimeout(timeout); // // } // }); // // Initialize navigation system // function initializeNavigation() { // initializeNavigationIds(); // restoreActiveNavigation(); // } // // Initialize when DOM is ready // if (document.readyState === 'loading') { // document.addEventListener('DOMContentLoaded', initializeNavigation); // } else { // initializeNavigation(); // } // // Opinion section scroll handling // if (window.location.search=="?opinion") { // const opinionWidget = document.querySelector('.opinion-wrapper .widget'); // if (opinionWidget) { // if (/constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && window['safari'].pushNotification))) { // opinionWidget.scrollIntoView(true); // } else if(typeof InstallTrigger !== 'undefined') { // opinionWidget.scrollIntoView(true); // } else { // opinionWidget.scrollIntoView({ // block: 'nearest', // behavior: 'smooth' // }); // } // } // } // // Delay function for mouse interactions // var delay = function (elem, callback) { // var timeout = null; // elem.onmouseover = function() { // elem.classList.add('shit') // // Set timeout to be a timer which will invoke callback after 1s // timeout = setTimeout(callback, 1000); // }; // elem.onmouseout = function() { // doc_body.classList.remove('hide-sec_nav'); // clearTimeout(timeout); // } // }; }); window.REBELMOUSE_TASKS_QUEUE.push(function(){ // Scroll position for primary navigation function init() { const isMobile = window.innerWidth <= 768; let menuButtonSize = 0; const menuButton = document.querySelector(".navbar .nav .sticky-left-click"); if (menuButton) { menuButtonSize = menuButton.getBoundingClientRect().width; } var doc_body = document.body; var pri_nav = document.querySelector(".navbar .nav"); var hamb_nav = document.querySelector(".hamburger .nav"); // Checking active primary menu item and calculating left scroll for the navigation const activeMenuItem = document.querySelector( ".navbar .nav .nav--item.active" ); if (activeMenuItem) { const activeMenuItemLeftPosition = activeMenuItem.offsetLeft; const navigation = document.querySelector(".navbar .nav"); const navigationComputedStyles = window.getComputedStyle(navigation); const marginLeft = parseInt( navigationComputedStyles.getPropertyValue("margin-left") ); pri_nav.scrollLeft = activeMenuItemLeftPosition - marginLeft - menuButtonSize; } if (!isMobile && window.sessionStorage.getItem("pri_nav_pos")) { pri_nav.scrollLeft = window.sessionStorage.getItem("pri_nav_pos"); } // The logic for the secondary menu wasn't changed if ( window.sessionStorage.getItem("sec_nav_pos") && window.sessionStorage.getItem("sec_nav_wrap") ) { var scrolli__item = document.querySelector( "." + window.sessionStorage.getItem("sec_nav_wrap") + " .list" ); if (scrolli__item) { scrolli__item.scrollLeft = window.sessionStorage.getItem("sec_nav_pos"); } } window.pri_nav_items = pri_nav.querySelectorAll("a"); window.sec_nav_items = document.querySelectorAll(".navbar .secondary--nav a"); window.hamb_nav_items = hamb_nav.querySelectorAll("a"); // Primary navigation click handlers pri_nav_items.forEach(function (item) { item.onclick = function (event) { console.log("Primary nav clicked:", event.target); const watchLive = event.target?.classList.contains('watch-live-button'); const navItem = event.target.closest(".nav--item"); if (navItem) { // Remove active class from all primary nav items (both navbar and hamburger) document.querySelectorAll(".navbar .nav .nav--item").forEach((el) => { el.classList.remove("active"); }); document .querySelectorAll(".hamburger .nav .nav--item") .forEach((el) => { el.classList.remove("active"); }); // Add active class to clicked primary nav item navItem.classList.add("active"); // Find corresponding item in hamburger menu and activate it const href = item.getAttribute("href"); const correspondingHamb = Array.from(hamb_nav_items).find( (a) => a.getAttribute("href") === href ); if (correspondingHamb) { const corrHambNavItem = correspondingHamb.closest(".nav--item"); if (corrHambNavItem) { corrHambNavItem.classList.add("active"); } } // Save active primary nav item to sessionStorage const priNavId = navItem.getAttribute("data-pri-nav-id"); if (priNavId) { if(watchLive){ let watchChannelActive = document.querySelector('.nav--item.watch--channel__active'); let activeMenuItemLeftPosition = watchChannelActive.offsetLeft; let navigation = document.querySelector(".navbar .nav"); let navigationComputedStyles = window.getComputedStyle(navigation); let marginLeft = parseInt(navigationComputedStyles.getPropertyValue("margin-left")); let targetScrollPosition = activeMenuItemLeftPosition - marginLeft - menuButtonSize; watchLiveLink = document.querySelector('.navbar .nav--item.watch--channel__active') watchLive_navId = watchLiveLink.getAttribute("data-pri-nav-id") watchLive_secId = watchLiveLink.querySelector('[aria-label="Live"]').getAttribute("data-sec-nav-id") sessionStorage.setItem("active_pri_nav_item", watchLive_navId); sessionStorage.setItem("active_sec_nav_item", watchLive_secId); window.sessionStorage.setItem("pri_nav_pos", targetScrollPosition); } else { sessionStorage.setItem("active_pri_nav_item", priNavId); console.log("Saved active primary nav item:", priNavId); } } // Clear secondary nav active state when primary nav changes if(!watchLive){ sessionStorage.removeItem("active_sec_nav_item"); } document .querySelectorAll(".navbar .secondary--nav .list__item") .forEach((el) => { el.classList.remove("active"); }); } // Original sessionStorage handling sessionStorage.removeItem("pri_nav_pos"); sessionStorage.removeItem("sec_nav_wrap"); sessionStorage.removeItem("sec_nav_pos"); if(!watchLive){ window.sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); } }; }); // Secondary navigation click handlers sec_nav_items.forEach(function (item) { item.onclick = function (event) { const target = event.target; // Remove active class from all secondary nav list__items document .querySelectorAll(".navbar .secondary--nav .list__item") .forEach((el) => { el.classList.remove("active"); }); // Add active class to the closest .list__item const listItem = target.closest(".list__item"); if (listItem) { listItem.classList.add("active"); } // Save active secondary nav item to sessionStorage const secNavId = target.getAttribute("data-sec-nav-id"); if (secNavId) { sessionStorage.setItem("active_sec_nav_item", secNavId); } // KEEP primary nav active and save it (if it's a sub-menu) const navItem = target.closest(".nav--item"); if (navItem) { const priNavId = navItem.getAttribute("data-pri-nav-id"); if (priNavId) { sessionStorage.setItem("active_pri_nav_item", priNavId); } } // Store scroll positions sessionStorage.removeItem("sec_nav_wrap"); sessionStorage.removeItem("sec_nav_pos"); const sec_nav_wrap = target.closest(".list"); if (sec_nav_wrap) { sessionStorage.setItem("sec_nav_pos", sec_nav_wrap.scrollLeft); const navItem = sec_nav_wrap.closest(".nav--item"); if (navItem && navItem.classList[1]) { sessionStorage.setItem("sec_nav_wrap", navItem.classList[1]); } } sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); }; }); // Watch Live button click handler const watchLiveButton = document.querySelector('.sticky-left .watch-live-button'); if (watchLiveButton) { watchLiveButton.onclick = function(event) { console.log('Watch Live button clicked:', event.target); // Find the nav--item with watch--channel__active active classes const watchChannelActive = document.querySelector('.nav--item.watch--channel__active.active'); if (watchChannelActive) { // Get the secondary navigation from this element const secondaryNav = watchChannelActive.querySelector('.secondary--nav'); if (secondaryNav) { // Find the active secondary nav item (Live) const activeSecondaryItem = secondaryNav.querySelector('.list__item.active'); if (activeSecondaryItem) { const secNavId = activeSecondaryItem.getAttribute('data-sec-nav-id'); if (secNavId) { sessionStorage.setItem('active_sec_nav_item', secNavId); console.log('Saved active secondary nav item from watch channel:', secNavId); } } // Save the watch channel primary nav as active const priNavId = watchChannelActive.getAttribute('data-pri-nav-id'); if (priNavId) { sessionStorage.setItem('active_pri_nav_item', priNavId); console.log('Saved active primary nav item from watch channel:', priNavId); } // Store scroll positions for secondary nav const secNavList = secondaryNav.querySelector('.list'); if (secNavList) { sessionStorage.setItem("sec_nav_pos", secNavList.scrollLeft); if (watchChannelActive.classList[1]) { sessionStorage.setItem("sec_nav_wrap", watchChannelActive.classList[1]); } } // Store primary nav scroll position sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); } } }; } // Hamburger navigation click handlers hamb_nav_items.forEach(function (item) { item.onclick = function (event) { console.log("Hamburger nav clicked:", event.target); const navItem = event.target.closest(".nav--item"); if (navItem) { // Remove active class from all primary nav items document.querySelectorAll(".navbar .nav .nav--item").forEach((el) => { el.classList.remove("active"); }); document .querySelectorAll(".hamburger .nav .nav--item") .forEach((el) => { el.classList.remove("active"); }); // Add active class to clicked hamburger nav item navItem.classList.add("active"); // Find corresponding item in primary nav and activate it const href = item.getAttribute("href"); const corresponding = Array.from( document.querySelectorAll(".navbar .nav .nav--item a") ).find((a) => a.getAttribute("href") === href); if (corresponding) { const corrNavItem = corresponding.closest(".nav--item"); if (corrNavItem) { corrNavItem.classList.add("active"); } } // Save active primary nav item to sessionStorage const priNavId = navItem.getAttribute("data-pri-nav-id"); if (priNavId) { sessionStorage.setItem("active_pri_nav_item", priNavId); console.log("Saved active primary nav item:", priNavId); } // Clear secondary nav active state when primary nav changes sessionStorage.removeItem("active_sec_nav_item"); document .querySelectorAll(".navbar .secondary--nav .list__item") .forEach((el) => { el.classList.remove("active"); }); } // Original sessionStorage handling sessionStorage.removeItem("pri_nav_pos"); sessionStorage.removeItem("sec_nav_wrap"); sessionStorage.removeItem("sec_nav_pos"); window.sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); }; }); // Hover effects for nav items document.querySelectorAll(".nav--item").forEach(function (item) { var timeout = null; var timeout2 = null; // Uncomment if you want hover effects // item.onmouseover = function() { // timeout = setTimeout(function(){ // item.classList.add('hover_active') // }, 300); // clearTimeout(timeout2); // } // item.onmouseout = function() { // timeout2 = setTimeout(function(){ // item.classList.remove('hover_active') // }, 300); // clearTimeout(timeout); // } }); } function restoreActiveNavigation() { const isMobile = window.innerWidth <= 768; if (isMobile) { console.log("Mobile detected - skipping sessionStorage restore"); return; } const activePriNavItem = sessionStorage.getItem("active_pri_nav_item"); const activeSecNavItem = sessionStorage.getItem("active_sec_nav_item"); // Always restore primary nav first (if it exists) if (activePriNavItem) { const priElement = document.querySelector( `.navbar [data-pri-nav-id="${activePriNavItem}"]` ); if (priElement) { // Clear all primary nav items document .querySelectorAll(".navbar .nav .nav--item") .forEach((el) => el.classList.remove("active")); document .querySelectorAll(".hamburger .nav .nav--item") .forEach((el) => el.classList.remove("active")); // Set primary nav as active priElement.classList.add("active"); console.log("Restored active class to primary nav:", priElement); // Activate corresponding hamburger item const priLink = priElement.querySelector("a"); if (priLink) { const href = priLink.getAttribute("href"); const correspondingHamb = Array.from(window.hamb_nav_items).find( (a) => a.getAttribute("href") === href ); if (correspondingHamb) { const corrHambNavItem = correspondingHamb.closest(".nav--item"); if (corrHambNavItem) { corrHambNavItem.classList.add("active"); console.log( "Restored active class to hamburger nav:", corrHambNavItem ); } } } } } // Then restore secondary nav (if it exists) if (activeSecNavItem) { const secElement = document.querySelector( `[data-sec-nav-id="${activeSecNavItem}"]` ); if (secElement) { document .querySelectorAll(".navbar .secondary--nav .list__item") .forEach((el) => el.classList.remove("active")); const listItem = secElement.closest(".list__item"); if (listItem) { listItem.classList.add("active"); console.log("Restored active secondary nav:", listItem); } } } } // Add unique identifiers to navigation items function initializeNavigationIds() { // Add IDs to primary nav items pri_nav_items.forEach(function (item, index) { const navItem = item.closest(".nav--item"); if (navItem && !navItem.hasAttribute("data-pri-nav-id")) { navItem.setAttribute("data-pri-nav-id", `pri-nav-${index}`); } }); // Add IDs to hamburger nav items hamb_nav_items.forEach(function (item, index) { const navItem = item.closest(".nav--item"); if (navItem && !navItem.hasAttribute("data-pri-nav-id")) { navItem.setAttribute("data-pri-nav-id", `pri-nav-${index}`); } }); // Add IDs to secondary nav items sec_nav_items.forEach(function (item, index) { if (!item.hasAttribute("data-sec-nav-id")) { item.setAttribute("data-sec-nav-id", `sec-nav-${index}`); } }); } // Initialize navigation system function initializeNavigation() { init(); initializeNavigationIds(); if(window.location.pathname === "/watch/live"){ restoreActiveNavigation(); } } // Initialize when DOM is ready // if (document.readyState === 'loading') { // document.addEventListener('DOMContentLoaded', initializeNavigation); // } else { // initializeNavigation(); // } REBELMOUSE_STDLIB.createElementChangeListener(".hamburger", function () { initializeNavigation(); }); // Opinion section scroll handling if (window.location.search == "?opinion") { const opinionWidget = document.querySelector(".opinion-wrapper .widget"); if (opinionWidget) { if ( /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })( !window["safari"] || (typeof safari !== "undefined" && window["safari"].pushNotification) ) ) { opinionWidget.scrollIntoView(true); } else if (typeof InstallTrigger !== "undefined") { opinionWidget.scrollIntoView(true); } else { opinionWidget.scrollIntoView({ block: "nearest", behavior: "smooth", }); } } } // Delay function for mouse interactions var delay = function (elem, callback) { var timeout = null; elem.onmouseover = function () { elem.classList.add("shit"); // Set timeout to be a timer which will invoke callback after 1s timeout = setTimeout(callback, 1000); }; elem.onmouseout = function () { doc_body.classList.remove("hide-sec_nav"); clearTimeout(timeout); }; }; }); window.REBELMOUSE_TASKS_QUEUE.push(function(){ var pri_nav = document.querySelector('.navbar .nav'); var secondary_navs = Array.from(document.querySelectorAll('.secondary--nav')); var sec_nav_left_btn = document.querySelector(".secondary--nav__arrow.left"); var sec_nav_right_btn = document.querySelector(".secondary--nav__arrow.right"); secondary_navs.map(item => { const left = sec_nav_left_btn.cloneNode(true); const right = sec_nav_right_btn.cloneNode(true); item.append(left); item.append(right) }); REBELMOUSE_STDLIB.createElementChangeListener('.primary--nav__arrow', function (item) { buttonNextPrevVisiblity(0, item, pri_nav, ""); item.addEventListener("click", function () { const scroll_distance = item.classList.contains('left') ? -(pri_nav.clientWidth) : pri_nav.clientWidth; pri_nav.scrollBy({ left: scroll_distance, behavior: 'smooth' }); buttonNextPrevVisiblity(770,item,pri_nav,item.classList.contains('left')?"left":"right") }) }) REBELMOUSE_STDLIB.createElementChangeListener('.secondary--nav .secondary--nav__arrow', function (item) { const secondary_nav = item.closest('.secondary--nav').querySelector('.list'); if (secondary_nav) { buttonNextPrevVisiblity(0, item, secondary_nav, item, ""); } item.addEventListener("click", function () { if (secondary_nav) { const scroll_distance = item.classList.contains('left') ? -calculateScrollDistance(secondary_nav) : calculateScrollDistance(secondary_nav); secondary_nav.scrollBy({ left: scroll_distance, behavior: 'smooth' }); buttonNextPrevVisiblity(770, item, secondary_nav, item.classList.contains('left') ? "left" : "right"); } }); }); function calculateScrollDistance(secondary_nav) { const navLeft = secondary_nav.getBoundingClientRect().left; window.nav_leftttt = secondary_nav; const list = secondary_nav.querySelectorAll('a'); const navWidth = secondary_nav.clientWidth; let scroll_distance = 0; let j = 0; while (j < list.length) { //debugger const item = list[j++]; const itemWidth = item.clientWidth; const itemLeft = item.getBoundingClientRect().left; if (itemWidth + 20 + scroll_distance < navWidth + 20 && (itemLeft >= navLeft && itemLeft + 2 < navWidth + navLeft)) { scroll_distance=scroll_distance+itemWidth + 20; } else if (itemWidth + 20 + scroll_distance > navWidth) { break; } } return scroll_distance; } function buttonNextPrevVisiblity(timeOffset, btn, scrolling_item, clicked) { //console.log('scrolling item scroll - ', scrolling_item.scrollWidth); if (scrolling_item.scrollWidth <= scrolling_item.clientWidth + 5 && btn.classList.contains('right')) { btn.classList.remove("hidden"); } setTimeout(sccc => { if (btn.classList.contains('left')) { //console.log('scroll left - ', scrolling_item.scrollLeft); scrolling_item.scrollLeft > 0 ? btn.classList.remove("hidden") : btn.classList.add("hidden"); } if (btn.classList.contains('right')) { if (scrolling_item.scrollWidth <= scrolling_item.clientWidth + scrolling_item.scrollLeft + 5) { btn.classList.add("hidden"); } else { btn.classList.remove("hidden"); } } if (clicked == "left") { btn.nextElementSibling.classList.remove("hidden"); } if (clicked == "right") { btn.previousElementSibling.classList.remove("hidden") } }, timeOffset); } }); window.REBELMOUSE_TASKS_QUEUE.push(function(){ REBELMOUSE_STDLIB.createElementChangeListener('.show-only-if-post-present', function (item) { if (!item.querySelector('.widget')) { item.classList.add('hidden'); if(item.nextSibling.classList.contains('ad--placeholder')){ item.nextSibling.remove(); } } }); REBELMOUSE_STDLIB.createElementChangeListener('.show-only-if-four-post-present', function (item) { if (item.querySelectorAll('.widget').length <= 3) { item.classList.add('hidden'); } }) REBELMOUSE_STDLIB.createElementChangeListener('.rebellt-ecommerce--price', function (item) { item.innerHTML = item.innerHTML.replace(/\$/g, '£'); }) }); window.REBELMOUSE_TASKS_QUEUE.push(function(){ // Piano object tp = window['tp'] || []; const addInfoToTP = () => { const preDefinedInfo = document.querySelector('.js-all-tags'); let allTags = `${preDefinedInfo.dataset.tags.replace(/[\[\]']+/g,'')}`; let primarySectionTitle = preDefinedInfo.dataset.contentSection; let postAuthor = preDefinedInfo.dataset.author; let postType = preDefinedInfo.dataset.contentType; let cd1 = preDefinedInfo.dataset.cd1; let cd2 = preDefinedInfo.dataset.cd2; let cd9 = preDefinedInfo.dataset.cd9; let cd11 = window.matchMedia('(display-mode: standalone)').matches ? 'pwa' : 'web'; // console.log(cd11); let cd12 = preDefinedInfo.dataset.cd12; let cd13 = preDefinedInfo.dataset.cd13; let cd14 = preDefinedInfo.dataset.cd14; let cd15 = preDefinedInfo.dataset.cd15; let cd16 = preDefinedInfo.dataset.cd16; let cd17 = preDefinedInfo.dataset.cd17; let cd18 = preDefinedInfo.dataset.cd18; let cd19 = document.referrer.split("/")[2] || 'not set'; let cd23 = 'not set'; let cd25 = window.navigator.userAgent; const getInfo = (string) => string.split('\':')[1].replace(/[&#,+()$~%.'"*?<>{}]/g, '').trim(); const passDataToTp = (type, data) => tp.push([type, data]); const passCustomDataToTp = (name, data) => tp.push(['setCustomVariable', name, data]); primarySectionTitle = getInfo(primarySectionTitle); passDataToTp('setContentSection', primarySectionTitle); postAuthor = getInfo(postAuthor); passDataToTp('setContentAuthor', postAuthor); postType = getInfo(postType); passCustomDataToTp('content_type', postType); cd1 = getInfo(cd1); passCustomDataToTp('cd1', cd1); cd2 = getInfo(cd2); passCustomDataToTp('cd2', cd2); cd9 = getInfo(cd9); passCustomDataToTp('cd9', cd9); passCustomDataToTp('cd11', cd11); cd12 = getInfo(cd12); passCustomDataToTp('cd12', cd12); cd13 = getInfo(cd13); passCustomDataToTp('cd13', cd13); cd14 = getInfo(cd14); passCustomDataToTp('cd14', cd14); cd15 = getInfo(cd15); passCustomDataToTp('cd15', cd15); cd16 = getInfo(cd16); passCustomDataToTp('cd16', cd16); cd17 = getInfo(cd17); passCustomDataToTp('cd17', cd17); cd18 = getInfo(cd18); passCustomDataToTp('cd18', cd18); passCustomDataToTp('cd19', cd19); passCustomDataToTp('cd23', cd23); passCustomDataToTp('cd25', cd25); return allTags.length ? passDataToTp('setTags', allTags) : false; } addInfoToTP(); });