document.addEventListener(“DOMContentLoaded”, function () { const mainHeaderMenu = document.querySelector(“.main-header-menu”); if (!mainHeaderMenu) return; const mainMenuItemsWithChildren = mainHeaderMenu.querySelectorAll(“.wp-block-navigation-item.has-child”); const customContainer = document.querySelector(“.custom-submenu-container”); if (!customContainer) return; // Create overlay const overlay = document.createElement(“div”); overlay.classList.add(“custom-overlay”); document.body.appendChild(overlay); let isMenuOpen = false; let currentSubmenu = null; let eventListeners = new Map(); // Store event listeners for clean removal let hoverTimeout = null; function isDesktopView() { return window.innerWidth >= 768; } function openDesktopMenu(menuItem) { const submenu = menuItem.querySelector(“.wp-block-navigation__submenu-container”); if (!submenu) return; const submenuClone = submenu.cloneNode(true); customContainer.innerHTML = “”; customContainer.appendChild(submenuClone); customContainer.style.display = “flex”; overlay.style.display = “block”; isMenuOpen = true; currentSubmenu = menuItem; } function closeDesktopMenu() { customContainer.style.display = “none”; overlay.style.display = “none”; isMenuOpen = false; currentSubmenu = null; } // Function to add desktop-specific event handlers function setupDesktopBehavior() { if (!isDesktopView()) return; // First, remove any previously set listeners to avoid duplicates removeAllEventListeners(); mainMenuItemsWithChildren.forEach(menuItem => { // Hover handlers with better event handling const mouseEnterHandler = function (e) { // Clear any pending close timeout if (hoverTimeout) { clearTimeout(hoverTimeout); hoverTimeout = null; } // Only open if not already showing this menu if (currentSubmenu !== menuItem) { openDesktopMenu(menuItem); } }; const mouseLeaveHandler = function (e) { // Check if we’re actually leaving the menu item area const relatedTarget = e.relatedTarget; // Don’t close if moving to the custom container or staying within menu item if (relatedTarget && ( customContainer.contains(relatedTarget) || menuItem.contains(relatedTarget) )) { return; } // Delay closing to allow moving to submenu hoverTimeout = setTimeout(() => { closeDesktopMenu(); }, 200); }; eventListeners.set(menuItem, { mouseEnterHandler, mouseLeaveHandler }); menuItem.addEventListener(“mouseenter”, mouseEnterHandler); menuItem.addEventListener(“mouseleave”, mouseLeaveHandler); // Click handlers (for toggle behavior) const clickHandler = function (e) { e.preventDefault(); e.stopPropagation(); if (isMenuOpen && menuItem === currentSubmenu) { closeDesktopMenu(); } else { openDesktopMenu(menuItem); } }; eventListeners.set(menuItem + “_click”, clickHandler); menuItem.addEventListener(“click”, clickHandler); // Add the same toggle logic to the submenu toggle button const toggleButton = menuItem.querySelector(“.wp-block-navigation-submenu__toggle”); if (toggleButton) { const toggleHandler = function (e) { e.preventDefault(); e.stopPropagation(); if (isMenuOpen && menuItem === currentSubmenu) { closeDesktopMenu(); } else { openDesktopMenu(menuItem); } }; eventListeners.set(toggleButton, toggleHandler); toggleButton.addEventListener(“click”, toggleHandler); } }); // Add hover handlers to custom container to keep it open const containerMouseEnterHandler = function () { if (hoverTimeout) { clearTimeout(hoverTimeout); hoverTimeout = null; } }; const containerMouseLeaveHandler = function () { hoverTimeout = setTimeout(() => { closeDesktopMenu(); }, 200); }; eventListeners.set(customContainer, { containerMouseEnterHandler, containerMouseLeaveHandler }); customContainer.addEventListener(“mouseenter”, containerMouseEnterHandler); customContainer.addEventListener(“mouseleave”, containerMouseLeaveHandler); // Handle click outside to close menu const documentClickHandler = function (e) { if ( isMenuOpen && !customContainer.contains(e.target) && !currentSubmenu?.contains(e.target) ) { closeDesktopMenu(); } }; eventListeners.set(document, documentClickHandler); document.addEventListener(“click”, documentClickHandler); const overlayClickHandler = function () { closeDesktopMenu(); }; eventListeners.set(overlay, overlayClickHandler); overlay.addEventListener(“click”, overlayClickHandler); } // Function to remove all custom event listeners function removeAllEventListeners() { // Clear any pending timeout if (hoverTimeout) { clearTimeout(hoverTimeout); hoverTimeout = null; } eventListeners.forEach((handler, element) => { if (element === document) { document.removeEventListener(“click”, handler); } else if (element === overlay) { overlay.removeEventListener(“click”, handler); } else if (element === customContainer) { customContainer.removeEventListener(“mouseenter”, handler.containerMouseEnterHandler); customContainer.removeEventListener(“mouseleave”, handler.containerMouseLeaveHandler); } else if (typeof element === “string” && element.includes(“_click”)) { // Skip these, they’re handled differently } else if (handler.mouseEnterHandler) { const menuItem = element; menuItem.removeEventListener(“mouseenter”, handler.mouseEnterHandler); menuItem.removeEventListener(“mouseleave”, handler.mouseLeaveHandler); } else { element.removeEventListener(“click”, handler); } }); eventListeners.clear(); } // Function to handle view changes function handleViewChange() { if (isDesktopView()) { setupDesktopBehavior(); } else { // For mobile: completely remove our handlers removeAllEventListeners(); closeDesktopMenu(); } } // Initial setup handleViewChange(); // Handle window resize window.addEventListener(“resize”, function () { handleViewChange(); }); });

Point AI

Powered by AI and perfected by seasoned editors. Every story blends AI speed with human judgment.

EXCLUSIVE

$9.4 billion raised from ICOs within first 5 months of 2018

cryptocurrency
Subject(s): ,

Psst… you’re reading Techpoint Digest

Every day, we handpick the biggest stories, skip the noise, and bring you a fun digest you can trust.

Digest Subscription (In-post)

In spite of the global clampdown on cryptocurrency by governments and Internet companies, the digital currency keeps getting more relevance.

According to CoinSchedule, the sum of $9.4 billion was raised via initial coin offerings (ICOs) between January and May 2018, which is higher than the total figure raised in 2017 — $3.88 billion.

ICOs are a means of raising funds via cryptocurrencies for a venture or startup over the internet in small amounts from a large number of people. Investopedia explains further that in an ICO, a percentage of the cryptocurrency is sold to early backers of the project or startup in exchange for legal tender or other cryptocurrencies, but usually for Bitcoin.

Earlier in the year, SureRemit — a non-cash remittance startup — became the first company in the West African region to launch an ICO. Worthy of note is that SureRemit’s ICO was done outside Nigeria, probably on the ground that cryptocurrency has no legal backing in the country.

The national assembly recently beckoned on the Central Bank of Nigeria (CBN) as well as the Nigerian Deposit Insurance Commission (NDIC) to put forward a regulatory framework for blockchain in the country.

We can keep considering cryptocurrency as a buzz word but according to figures from CoinSchedule, about a million dollars was already raised in ICOs between June 4 and 5, 2018.

Going the ICO route really takes out the bottlenecks preventing startups from raising funds through an initial public offering (IPO). To get listed on the Nigerian Stock Exchange, the requirement for Standard A is a cumulative pre-tax profit from continuing operations of not less than ₦300 million over 3 years, with at least ₦100 million pre-tax profit in 2 of those years.

The CBN has over time stated its stance on cryptocurrency. But in spite of the apex bank’s unfavourable position on digital currency, the world will not wait for Nigeria to catch up.

Follow Techpoint Africa on WhatsApp!

Never miss a beat on tech, startups, and business news from across Africa with the best of journalism.

Follow

Read next