Browse Source

change default true resulting in wiki default and not in site selection; deleting duplicate toc in page

pull/7308/head
Timo Kruth 10 months ago
parent
commit
c7842cf33a
2 changed files with 5 additions and 15 deletions
  1. 11
      client/themes/default/components/page.vue
  2. 9
      server/controllers/common.js

11
client/themes/default/components/page.vue

@ -94,17 +94,6 @@
)
v-card.page-toc-card.mb-5(v-if='tocDecoded.length')
.overline.pa-5.pb-0(:class='$vuetify.theme.dark ? `blue--text text--lighten-2` : `primary--text`') {{$t('common:page.toc')}}
v-list.pb-3(dense, nav, :class='$vuetify.theme.dark ? `darken-3-d3` : ``')
template(v-for='(tocItem, tocIdx) in tocDecoded')
v-list-item(@click='$vuetify.goTo(tocItem.anchor, scrollOpts)')
v-icon(color='grey', small) {{ $vuetify.rtl ? `mdi-chevron-left` : `mdi-chevron-right` }}
v-list-item-title.px-3 {{tocItem.title}}
//- v-divider(v-if='tocIdx < toc.length - 1 || tocItem.children.length')
template(v-for='tocSubItem in tocItem.children')
v-list-item(@click='$vuetify.goTo(tocSubItem.anchor, scrollOpts)')
v-icon.px-3(color='grey lighten-1', small) {{ $vuetify.rtl ? `mdi-chevron-left` : `mdi-chevron-right` }}
v-list-item-title.px-3.caption.grey--text(:class='$vuetify.theme.dark ? `text--lighten-1` : `text--darken-1`') {{tocSubItem.title}}
//- v-divider(inset, v-if='tocIdx < toc.length - 1')
v-list.py-2(dense, nav, :class='$vuetify.theme.dark ? `darken-3-d3` : ``')
page-toc-item(
v-for='(item, idx) in tocDecoded'

9
server/controllers/common.js

@ -513,10 +513,11 @@ router.get('/*', async (req, res, next) => {
}
// -> Set TOC display options
const tocOptions = _.get(page, 'tocOptions.useDefault', true) ? {
min: page.tocOptions.min,
max: page.tocOptions.max
} : WIKI.config.theming.tocDepth
const tocOptions = _.get(page, 'tocOptions.useDefault', true) ?
WIKI.config.theming.tocDepth : {
min: page.tocOptions.min,
max: page.tocOptions.max
}
if (req.query.legacy || req.get('user-agent').indexOf('Trident') >= 0) {
// -> Convert page TOC

Loading…
Cancel
Save