From 11c5b0fa8ac5a8db2c31182af13d285fd638e364 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Tue, 12 Dec 2023 00:07:52 +0100 Subject: [PATCH] Minor tweak to help future admins --- amd/build/primary-nav-tools.min.js | 2 +- amd/build/primary-nav-tools.min.js.map | 2 +- amd/src/primary-nav-tools.js | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/amd/build/primary-nav-tools.min.js b/amd/build/primary-nav-tools.min.js index bfb2173..ddf13c0 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.hide_primary=function(hrefs){let element=document.createElement("style");document.head.appendChild(element);let sheet=element.sheet;("string"==typeof hrefs||hrefs instanceof String)&&(hrefs=[hrefs]);if("object"==typeof hrefs&&Array.isArray(hrefs))for(const ix in hrefs){let style=`\n .primary-navigation li.nav-item > a[href*="${hrefs[ix]}"] {\n display: none;\n }\n `;sheet.insertRule(style,sheet.cssRules.length)}}})); +define("local_treestudyplan/primary-nav-tools",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.hide_primary=function(hrefs){let element=document.createElement("style");document.head.appendChild(element);let sheet=element.sheet;("string"==typeof hrefs||hrefs instanceof String)&&(hrefs=[hrefs]);if("object"==typeof hrefs&&Array.isArray(hrefs))for(const ix in hrefs){const href=hrefs[ix];let style=`\n .primary-navigation li.nav-item > a[href*="${href}"] {\n display: none;\n }\n `;sheet.insertRule(style,sheet.cssRules.length),style=`\n #usernavigation a[href*="${href}"] {\n display: none;\n }\n `,sheet.insertRule(style,sheet.cssRules.length)}}})); //# 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 bc4de90..30d7c4d 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\n/**\n * Hide a primary navigation item by href\n * @param {string|Array} hrefs The link that should be hidden\n */\nexport function hide_primary(hrefs) {\n let element = document.createElement('style');\n document.head.appendChild(element);\n let sheet = element.sheet;\n\n if(typeof hrefs === 'string' || hrefs instanceof String){\n hrefs = [hrefs];\n }\n\n if(typeof hrefs === 'object' && Array.isArray(hrefs)){\n for(const ix in hrefs){\n const href = hrefs[ix];\n let style = `\n .primary-navigation li.nav-item > a[href*=\"${href}\"] {\n display: none;\n }\n `;\n sheet.insertRule(style, sheet.cssRules.length);\n }\n }\n}\n"],"names":["hrefs","element","document","createElement","head","appendChild","sheet","String","Array","isArray","ix","style","insertRule","cssRules","length"],"mappings":"sKAM6BA,WACrBC,QAAUC,SAASC,cAAc,SACrCD,SAASE,KAAKC,YAAYJ,aACtBK,MAAQL,QAAQK,OAEA,iBAAVN,OAAsBA,iBAAiBO,UAC7CP,MAAQ,CAACA,WAGO,iBAAVA,OAAsBQ,MAAMC,QAAQT,WACtC,MAAMU,MAAMV,MAAM,KAEdW,MAAS,gEADAX,MAAMU,+EAMnBJ,MAAMM,WAAWD,MAAOL,MAAMO,SAASC"} \ 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\n/**\n * Hide a primary navigation item by href\n * @param {string|Array} hrefs The link that should be hidden\n */\nexport function hide_primary(hrefs) {\n let element = document.createElement('style');\n document.head.appendChild(element);\n let sheet = element.sheet;\n\n if(typeof hrefs === 'string' || hrefs instanceof String){\n hrefs = [hrefs];\n }\n\n if(typeof hrefs === 'object' && Array.isArray(hrefs)){\n for(const ix in hrefs){\n const href = hrefs[ix];\n let style = `\n .primary-navigation li.nav-item > a[href*=\"${href}\"] {\n display: none;\n }\n `;\n sheet.insertRule(style, sheet.cssRules.length);\n style = `\n #usernavigation a[href*=\"${href}\"] {\n display: none;\n }\n `;\n sheet.insertRule(style, sheet.cssRules.length);\n }\n }\n}\n"],"names":["hrefs","element","document","createElement","head","appendChild","sheet","String","Array","isArray","ix","href","style","insertRule","cssRules","length"],"mappings":"sKAM6BA,WACrBC,QAAUC,SAASC,cAAc,SACrCD,SAASE,KAAKC,YAAYJ,aACtBK,MAAQL,QAAQK,OAEA,iBAAVN,OAAsBA,iBAAiBO,UAC7CP,MAAQ,CAACA,WAGO,iBAAVA,OAAsBQ,MAAMC,QAAQT,WACtC,MAAMU,MAAMV,MAAM,OACZW,KAAOX,MAAMU,QACfE,MAAS,gEACoCD,gFAIjDL,MAAMO,WAAWD,MAAON,MAAMQ,SAASC,QACvCH,MAAS,8CACsBD,gFAI/BL,MAAMO,WAAWD,MAAON,MAAMQ,SAASC"} \ No newline at end of file diff --git a/amd/src/primary-nav-tools.js b/amd/src/primary-nav-tools.js index c5aeac6..c42a245 100644 --- a/amd/src/primary-nav-tools.js +++ b/amd/src/primary-nav-tools.js @@ -22,6 +22,12 @@ export function hide_primary(hrefs) { } `; sheet.insertRule(style, sheet.cssRules.length); + style = ` + #usernavigation a[href*="${href}"] { + display: none; + } + `; + sheet.insertRule(style, sheet.cssRules.length); } } }