fix for hiding navigation links

This commit is contained in:
PMKuipers 2024-08-29 00:16:33 +02:00
parent 6518e00a31
commit bc774533f4
3 changed files with 3 additions and 3 deletions

View File

@ -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 //# sourceMappingURL=primary-nav-tools.min.js.map

View File

@ -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"} {"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"}

View File

@ -15,7 +15,7 @@ export function hidePrimary(hrefs) {
for (const ix in hrefs) { for (const ix in hrefs) {
const href = hrefs[ix]; const href = hrefs[ix];
css += ` css += `
#usernavigation a[href*="${href}"], .primary-navigation a[href*="${href}"],
.drawer-primary a[href*="${href}"] { .drawer-primary a[href*="${href}"] {
display: none !important; display: none !important;
} }