From bc774533f4732d58f13fa045ed44e8d57c452b1a Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Thu, 29 Aug 2024 00:16:33 +0200 Subject: [PATCH] fix for hiding navigation links --- amd/build/primary-nav-tools.min.js | 2 +- amd/build/primary-nav-tools.min.js.map | 2 +- amd/src/primary-nav-tools.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/amd/build/primary-nav-tools.min.js b/amd/build/primary-nav-tools.min.js index ecb8823..591adad 100644 --- a/amd/build/primary-nav-tools.min.js +++ b/amd/build/primary-nav-tools.min.js @@ -1,3 +1,3 @@ -define("local_treestudyplan/primary-nav-tools",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.hidePrimary=function(hrefs){("string"==typeof hrefs||hrefs instanceof String)&&(hrefs=[hrefs]);if("object"==typeof hrefs&&Array.isArray(hrefs)){let css="";for(const ix in hrefs){const href=hrefs[ix];css+=`\n #usernavigation a[href*="${href}"],\n .drawer-primary a[href*="${href}"] {\n display: none !important;\n }\n `}const element=document.createElement("style");element.setAttribute("type","text/css"),"textContent"in element?element.textContent=css:element.styleSheet.cssText=css,document.head.appendChild(element)}}})); +define("local_treestudyplan/primary-nav-tools",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.hidePrimary=function(hrefs){("string"==typeof hrefs||hrefs instanceof String)&&(hrefs=[hrefs]);if("object"==typeof hrefs&&Array.isArray(hrefs)){let css="";for(const ix in hrefs){const href=hrefs[ix];css+=`\n .primary-navigation a[href*="${href}"],\n .drawer-primary a[href*="${href}"] {\n display: none !important;\n }\n `}const element=document.createElement("style");element.setAttribute("type","text/css"),"textContent"in element?element.textContent=css:element.styleSheet.cssText=css,document.head.appendChild(element)}}})); //# sourceMappingURL=primary-nav-tools.min.js.map \ No newline at end of file diff --git a/amd/build/primary-nav-tools.min.js.map b/amd/build/primary-nav-tools.min.js.map index 5717e8d..9693a90 100644 --- a/amd/build/primary-nav-tools.min.js.map +++ b/amd/build/primary-nav-tools.min.js.map @@ -1 +1 @@ -{"version":3,"file":"primary-nav-tools.min.js","sources":["../src/primary-nav-tools.js"],"sourcesContent":["/* eslint-env es6*/\n/* eslint no-console: \"off\"*/\n\n/**\n * Hide a primary navigation item by href\n * @param {string|Array} hrefs The link that should be hidden\n */\nexport function hidePrimary(hrefs) {\n if (typeof hrefs === 'string' || hrefs instanceof String) {\n hrefs = [hrefs];\n }\n\n if (typeof hrefs === 'object' && Array.isArray(hrefs)) {\n let css = '';\n for (const ix in hrefs) {\n const href = hrefs[ix];\n css += `\n #usernavigation a[href*=\"${href}\"],\n .drawer-primary a[href*=\"${href}\"] {\n display: none !important;\n }\n `;\n }\n\n\n const element = document.createElement('style');\n element.setAttribute('type', 'text/css');\n\n if ('textContent' in element) {\n element.textContent = css;\n } else {\n element.styleSheet.cssText = css;\n }\n\n document.head.appendChild(element);\n\n }\n}\n"],"names":["hrefs","String","Array","isArray","css","ix","href","element","document","createElement","setAttribute","textContent","styleSheet","cssText","head","appendChild"],"mappings":"qKAO4BA,QACH,iBAAVA,OAAsBA,iBAAiBC,UAC9CD,MAAQ,CAACA,WAGQ,iBAAVA,OAAsBE,MAAMC,QAAQH,OAAQ,KAC/CI,IAAM,OACL,MAAMC,MAAML,MAAO,OACdM,KAAON,MAAMK,IACnBD,KAAQ,8CACuBE,qDACAA,iGAO7BC,QAAUC,SAASC,cAAc,SACvCF,QAAQG,aAAa,OAAQ,YAEzB,gBAAiBH,QACjBA,QAAQI,YAAcP,IAEtBG,QAAQK,WAAWC,QAAUT,IAGjCI,SAASM,KAAKC,YAAYR"} \ No newline at end of file +{"version":3,"file":"primary-nav-tools.min.js","sources":["../src/primary-nav-tools.js"],"sourcesContent":["/* eslint-env es6*/\n/* eslint no-console: \"off\"*/\n\n/**\n * Hide a primary navigation item by href\n * @param {string|Array} hrefs The link that should be hidden\n */\nexport function hidePrimary(hrefs) {\n if (typeof hrefs === 'string' || hrefs instanceof String) {\n hrefs = [hrefs];\n }\n\n if (typeof hrefs === 'object' && Array.isArray(hrefs)) {\n let css = '';\n for (const ix in hrefs) {\n const href = hrefs[ix];\n css += `\n .primary-navigation a[href*=\"${href}\"],\n .drawer-primary a[href*=\"${href}\"] {\n display: none !important;\n }\n `;\n }\n\n\n const element = document.createElement('style');\n element.setAttribute('type', 'text/css');\n\n if ('textContent' in element) {\n element.textContent = css;\n } else {\n element.styleSheet.cssText = css;\n }\n\n document.head.appendChild(element);\n\n }\n}\n"],"names":["hrefs","String","Array","isArray","css","ix","href","element","document","createElement","setAttribute","textContent","styleSheet","cssText","head","appendChild"],"mappings":"qKAO4BA,QACH,iBAAVA,OAAsBA,iBAAiBC,UAC9CD,MAAQ,CAACA,WAGQ,iBAAVA,OAAsBE,MAAMC,QAAQH,OAAQ,KAC/CI,IAAM,OACL,MAAMC,MAAML,MAAO,OACdM,KAAON,MAAMK,IACnBD,KAAQ,kDAC2BE,qDACJA,iGAO7BC,QAAUC,SAASC,cAAc,SACvCF,QAAQG,aAAa,OAAQ,YAEzB,gBAAiBH,QACjBA,QAAQI,YAAcP,IAEtBG,QAAQK,WAAWC,QAAUT,IAGjCI,SAASM,KAAKC,YAAYR"} \ No newline at end of file diff --git a/amd/src/primary-nav-tools.js b/amd/src/primary-nav-tools.js index b3ad8fc..0d60c43 100644 --- a/amd/src/primary-nav-tools.js +++ b/amd/src/primary-nav-tools.js @@ -15,7 +15,7 @@ export function hidePrimary(hrefs) { for (const ix in hrefs) { const href = hrefs[ix]; css += ` - #usernavigation a[href*="${href}"], + .primary-navigation a[href*="${href}"], .drawer-primary a[href*="${href}"] { display: none !important; }