From 3085e40426cc9cb9be835e461dece6159a68f22d Mon Sep 17 00:00:00 2001 From: caishi Date: Mon, 8 Nov 2021 15:12:12 +0800 Subject: [PATCH] hide --- src/forge/Head/Header.js | 187 +++++++++++++++++++-------------------- 1 file changed, 92 insertions(+), 95 deletions(-) diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index a0a6db11..692729ad 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -16,7 +16,6 @@ import './header.scss'; import NoticeContent from './NoticeContent'; const $ = window.$ // TODO 这部分脚本从公共脚本中直接调用 -const { Search } = Input; let old_url; window._header_componentHandler = null; @@ -56,26 +55,26 @@ class NewHeader extends Component { window._header_componentHandler = this; //下拉框的显示隐藏 - var hoverTimeout; - var hoveredPanel; - $(".edu-menu-panel").hover(function () { - if (hoverTimeout) { // 一次只显示一个panel - if (hoveredPanel && hoveredPanel !== this) { - $(hoveredPanel).find(".edu-menu-list").hide() - } - clearTimeout(hoverTimeout); - hoverTimeout = null; - } - hoveredPanel = this; - $(this).find(".edu-menu-list").show(); - }, function () { - var that = this; - // 延迟hide - hoverTimeout = setTimeout(function () { - $(that).find(".edu-menu-list").hide(); - }, 800) + // var hoverTimeout; + // var hoveredPanel; + // $(".edu-menu-panel").hover(function () { + // if (hoverTimeout) { // 一次只显示一个panel + // if (hoveredPanel && hoveredPanel !== this) { + // $(hoveredPanel).find(".edu-menu-list").hide() + // } + // clearTimeout(hoverTimeout); + // hoverTimeout = null; + // } + // hoveredPanel = this; + // $(this).find(".edu-menu-list").show(); + // }, function () { + // var that = this; + // // 延迟hide + // hoverTimeout = setTimeout(function () { + // $(that).find(".edu-menu-list").hide(); + // }, 800) - }); + // }); //获取游览器地址 try { window.sessionStorage.setItem("yslgeturls", JSON.stringify(window.location.href)) @@ -279,92 +278,90 @@ class NewHeader extends Component { }; render() { - const { match ,resetUserInfo ,showNotification,publicNav} = this.props; + const { resetUserInfo ,showNotification,publicNav} = this.props; let current_user = this.props.user; let { AccountProfiletype, user, isRender, - headtypesonClickbool, - headtypess, settings, visible, } = this.state; /*用户名称 用户头像url*/ - let activeIndex = false; - let activeForums = false; - let activeShixuns = false; - let activePaths = false; - let coursestype = false; - let activePackages = false; - let activeMoopCases = false; - let activeCompetitions = false; + // let activeIndex = false; + // let activeForums = false; + // let activeShixuns = false; + // let activePaths = false; + // let coursestype = false; + // let activePackages = false; + // let activeMoopCases = false; + // let activeCompetitions = false; - if (match.path === '/forums') { - activeForums = true; - } else if (match.path.startsWith('/shixuns')) { - activeShixuns = true; - } else if (match.path.startsWith('/paths')) { - activePaths = true; - } else if (match.path.startsWith('/courses')) { - coursestype = true; - } else if (match.path.startsWith('/crowdsourcing')) { - activePackages = true; - } else if (match.path.startsWith('/moop_cases')) { - activeMoopCases = true; - } else if (match.path.startsWith('/competitions')) { - activeCompetitions = true; - } else { - activeIndex = true; - } + // if (match.path === '/forums') { + // activeForums = true; + // } else if (match.path.startsWith('/shixuns')) { + // activeShixuns = true; + // } else if (match.path.startsWith('/paths')) { + // activePaths = true; + // } else if (match.path.startsWith('/courses')) { + // coursestype = true; + // } else if (match.path.startsWith('/crowdsourcing')) { + // activePackages = true; + // } else if (match.path.startsWith('/moop_cases')) { + // activeMoopCases = true; + // } else if (match.path.startsWith('/competitions')) { + // activeCompetitions = true; + // } else { + // activeIndex = true; + // } - let headtypes = '/'; - if (settings) { - if (settings.navbar) { - if (settings.navbar.length > 0) { - if (match.path === '/') { - if (headtypesonClickbool === false) { - headtypes = undefined; - } else { - headtypes = headtypess; - } - } else { - for (var i = 0; i < settings.navbar.length; i++) { - if (match.path === settings.navbar[i].link) { - headtypes = settings.navbar[i].link; - break; - } - } - } - } - } - } - let shixuntype = false; - let pathstype = false; - let coursestypes = false; - if (this.props && this.props.mygetHelmetapi != null) { - let shixun = "/shixuns"; - let paths = "/paths"; - let courses = "/courses"; - this.props.mygetHelmetapi && this.props.mygetHelmetapi.navbar && this.props.mygetHelmetapi.navbar.map((item, key) => { - var reg = RegExp(item.link); - if (shixun.match(reg)) { - if (item.hidden === true) { - shixuntype = true - } - } - if (paths.match(reg)) { - if (item.hidden === true) { - pathstype = true - } - } - if (courses.match(reg)) { - if (item.hidden === true) { - coursestypes = true - } - } - }) - } + // let headtypes = '/'; + // if (settings) { + // if (settings.navbar) { + // if (settings.navbar.length > 0) { + // if (match.path === '/') { + // if (headtypesonClickbool === false) { + // headtypes = undefined; + // } else { + // headtypes = headtypess; + // } + // } else { + // for (var i = 0; i < settings.navbar.length; i++) { + // if (match.path === settings.navbar[i].link) { + // headtypes = settings.navbar[i].link; + // break; + // } + // } + // } + // } + // } + // } + // let shixuntype = false; + // let pathstype = false; + // let coursestypes = false; + // if (this.props && this.props.mygetHelmetapi != null) { + // let shixun = "/shixuns"; + // let paths = "/paths"; + // let courses = "/courses"; + // this.props.mygetHelmetapi && this.props.mygetHelmetapi.navbar && this.props.mygetHelmetapi.navbar.map((item, key) => { + // var reg = RegExp(item.link); + // if (shixun.match(reg)) { + // if (item.hidden === true) { + // shixuntype = true + // } + // } + // if (paths.match(reg)) { + // if (item.hidden === true) { + // pathstype = true + // } + // } + // if (courses.match(reg)) { + // if (item.hidden === true) { + // coursestypes = true + // } + // } + // }) + // } let search_url = settings && settings.common && settings.common.search; return (