-
【需求】挖空依次显示
2023-11-04 21:30只在闪卡界面生效:
/* 闪卡的标记转挖空 CSS片段 */ .card__block .b3-typography [data-type~="mark"], .card__block .protyle-wysiwyg [data-type~="mark"] { color: transparent !important; padding: 0px 5px 0px 5px; background-color: transparent !important; background-image: none !important; border-bottom: 0.1em solid var(--b3-theme-on-background) !important; transition: all 300ms; } .card__block .b3-typography [data-type~="mark"]:hover, .card__block .protyle-wysiwyg [data-type~="mark"]:hover, .card__block .p.block-focus [data-type~="mark"] { color: var(--b3-theme-on-background) !important; transition: all 300ms; padding: 0px 5px 0px 5px; }
-
导航栏单击打开文档、双击展开子文档
2023-11-04 19:04第 1、3 条合并:点除图标外任意位置,打开该文档,同时在文档树中展开子文档
那你怎么翻目录?翻一下目录就会打开一堆文档
不如用这个代码片段,用中键展开子文档
/* 中键点击展开文档树 JS片段 */ (function(){ let g_reset = setInterval(main, 2000); function main() { if (document.querySelector('.sy__file')) { clearInterval(g_reset); }else{ return false; } document.querySelector('.sy__file').addEventListener('mousedown', event => { if (event.button != 1) return; let notTitleFlag = false; if (!event.target.classList.contains('b3-list-item__text')) notTitleFlag = true; let target = event.target.parentNode; let temp = event.target; console.log("0426",event); for (let i = 0; i < 4 && temp; i++) { if (temp?.getAttribute("data-type") == "navigation-file" || temp?.getAttribute("data-type") == "navigation-root") { target = temp; break; } temp = temp?.parentNode; } console.log("0426target", target); if (target?.getAttribute("data-type") == "navigation-file" || target?.getAttribute("data-type") == "navigation-root") { const b3ListItemToggle = target.querySelector('.b3-list-item__toggle'); const title = target.querySelector('.b3-list-item__text'); if (b3ListItemToggle.classList.contains('fn__hidden')) return; event.preventDefault(); b3ListItemToggle.click(); if (event.ctrlKey) { title.click(); } } }, true); } })();