page.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. <template lang="pug">
  2. v-app(v-scroll='upBtnScroll', :dark='$vuetify.theme.dark', :class='$vuetify.rtl ? `is-rtl` : `is-ltr`')
  3. nav-header
  4. v-navigation-drawer(
  5. v-if='navMode !== `NONE`'
  6. :class='$vuetify.theme.dark ? `grey darken-4-d4` : `primary`'
  7. dark
  8. app
  9. clipped
  10. mobile-breakpoint='600'
  11. :temporary='$vuetify.breakpoint.smAndDown'
  12. v-model='navShown'
  13. :right='$vuetify.rtl'
  14. )
  15. vue-scroll(:ops='scrollStyle')
  16. nav-sidebar(:color='$vuetify.theme.dark ? `grey darken-4-d4` : `primary`', :items='sidebarDecoded', :nav-mode='navMode')
  17. v-fab-transition(v-if='navMode !== `NONE`')
  18. v-btn(
  19. fab
  20. color='primary'
  21. fixed
  22. bottom
  23. :right='$vuetify.rtl'
  24. :left='!$vuetify.rtl'
  25. small
  26. @click='navShown = !navShown'
  27. v-if='$vuetify.breakpoint.mdAndDown'
  28. v-show='!navShown'
  29. )
  30. v-icon mdi-menu
  31. v-main(ref='content')
  32. template(v-if='path !== `home`')
  33. v-toolbar(:color='$vuetify.theme.dark ? `grey darken-4-d3` : `grey lighten-3`', flat, dense, v-if='$vuetify.breakpoint.smAndUp')
  34. //- v-btn.pl-0(v-if='$vuetify.breakpoint.xsOnly', flat, @click='toggleNavigation')
  35. //- v-icon(color='grey darken-2', left) menu
  36. //- span Navigation
  37. v-breadcrumbs.breadcrumbs-nav.pl-0(
  38. :items='breadcrumbs'
  39. divider='/'
  40. )
  41. template(slot='item', slot-scope='props')
  42. v-icon(v-if='props.item.path === "/"', small, @click='goHome') mdi-home
  43. v-btn.ma-0(v-else, :href='props.item.path', small, text) {{props.item.name}}
  44. template(v-if='!isPublished')
  45. v-spacer
  46. .caption.red--text {{$t('common:page.unpublished')}}
  47. status-indicator.ml-3(negative, pulse)
  48. v-divider
  49. v-container.grey.pa-0(fluid, :class='$vuetify.theme.dark ? `darken-4-l3` : `lighten-4`')
  50. v-row(no-gutters, align-content='center', style='height: 90px;')
  51. v-col.page-col-content.is-page-header(offset-xl='2', offset-lg='3', style='margin-top: auto; margin-bottom: auto;', :class='$vuetify.rtl ? `pr-4` : `pl-4`')
  52. .headline.grey--text(:class='$vuetify.theme.dark ? `text--lighten-2` : `text--darken-3`') {{title}}
  53. .caption.grey--text.text--darken-1 {{description}}
  54. v-divider
  55. v-container.pl-5.pt-4(fluid, grid-list-xl)
  56. v-layout(row)
  57. v-flex.page-col-sd(lg3, xl2, v-if='$vuetify.breakpoint.lgAndUp')
  58. v-card.mb-5(v-if='tocDecoded.length')
  59. .overline.pa-5.pb-0(:class='$vuetify.theme.dark ? `blue--text text--lighten-2` : `primary--text`') {{$t('common:page.toc')}}
  60. v-list.pb-3(dense, nav, :class='$vuetify.theme.dark ? `darken-3-d3` : ``')
  61. template(v-for='(tocItem, tocIdx) in tocDecoded')
  62. v-list-item(@click='$vuetify.goTo(tocItem.anchor, scrollOpts)')
  63. v-icon(color='grey', small) {{ $vuetify.rtl ? `mdi-chevron-left` : `mdi-chevron-right` }}
  64. v-list-item-title.px-3 {{tocItem.title}}
  65. //- v-divider(v-if='tocIdx < toc.length - 1 || tocItem.children.length')
  66. template(v-for='tocSubItem in tocItem.children')
  67. v-list-item(@click='$vuetify.goTo(tocSubItem.anchor, scrollOpts)')
  68. v-icon.px-3(color='grey lighten-1', small) {{ $vuetify.rtl ? `mdi-chevron-left` : `mdi-chevron-right` }}
  69. v-list-item-title.px-3.caption.grey--text(:class='$vuetify.theme.dark ? `text--lighten-1` : `text--darken-1`') {{tocSubItem.title}}
  70. //- v-divider(inset, v-if='tocIdx < toc.length - 1')
  71. v-card.mb-5(v-if='tags.length > 0')
  72. .pa-5
  73. .overline.teal--text.pb-2(:class='$vuetify.theme.dark ? `text--lighten-3` : ``') Tags
  74. v-chip.mr-1.mb-1(
  75. label
  76. :color='$vuetify.theme.dark ? `teal darken-1` : `teal lighten-5`'
  77. v-for='(tag, idx) in tags'
  78. :href='`/t/` + tag.tag'
  79. :key='`tag-` + tag.tag'
  80. )
  81. v-icon(:color='$vuetify.theme.dark ? `teal lighten-3` : `teal`', left, small) mdi-tag
  82. span(:class='$vuetify.theme.dark ? `teal--text text--lighten-5` : `teal--text text--darken-2`') {{tag.title}}
  83. v-chip.mr-1.mb-1(
  84. label
  85. :color='$vuetify.theme.dark ? `teal darken-1` : `teal lighten-5`'
  86. :href='`/t/` + tags.map(t => t.tag).join(`/`)'
  87. )
  88. v-icon(:color='$vuetify.theme.dark ? `teal lighten-3` : `teal`', size='20') mdi-tag-multiple
  89. v-card.mb-5(v-if='commentsEnabled && commentsPerms.read')
  90. .pa-5
  91. .overline.pb-2.blue-grey--text.d-flex.align-center(:class='$vuetify.theme.dark ? `text--lighten-3` : `text--darken-2`')
  92. span Talk
  93. //- v-spacer
  94. //- v-chip.text-center(
  95. //- v-if='!commentsExternal'
  96. //- label
  97. //- x-small
  98. //- :color='$vuetify.theme.dark ? `blue-grey darken-3` : `blue-grey darken-2`'
  99. //- dark
  100. //- style='min-width: 50px; justify-content: center;'
  101. //- )
  102. //- span {{commentsCount}}
  103. .d-flex
  104. v-btn.text-none(
  105. @click='goToComments()'
  106. :color='$vuetify.theme.dark ? `blue-grey` : `blue-grey darken-2`'
  107. outlined
  108. style='flex: 1 1 100%;'
  109. small
  110. )
  111. span.blue-grey--text(:class='$vuetify.theme.dark ? `text--lighten-1` : `text--darken-2`') View Discussion
  112. v-tooltip(right, v-if='commentsPerms.write')
  113. template(v-slot:activator='{ on }')
  114. v-btn.ml-2(
  115. @click='goToComments(true)'
  116. v-on='on'
  117. outlined
  118. small
  119. :color='$vuetify.theme.dark ? `blue-grey` : `blue-grey darken-2`'
  120. )
  121. v-icon(:color='$vuetify.theme.dark ? `blue-grey lighten-1` : `blue-grey darken-2`', dense) mdi-comment-plus
  122. span New Comment
  123. v-card.mb-5
  124. .pa-5
  125. .overline.indigo--text.d-flex(:class='$vuetify.theme.dark ? `text--lighten-3` : ``')
  126. span {{$t('common:page.lastEditedBy')}}
  127. v-spacer
  128. v-tooltip(right, v-if='isAuthenticated')
  129. template(v-slot:activator='{ on }')
  130. v-btn.btn-animate-edit(icon, :href='"/h/" + locale + "/" + path', v-on='on', x-small, v-if="hasReadHistoryPermission")
  131. v-icon(color='indigo', dense) mdi-history
  132. span {{$t('common:header.history')}}
  133. .body-2.grey--text(:class='$vuetify.theme.dark ? `` : `text--darken-3`') {{ authorName }}
  134. .caption.grey--text.text--darken-1 {{ updatedAt | moment('calendar') }}
  135. //- v-card.mb-5
  136. //- .pa-5
  137. //- .overline.pb-2.yellow--text(:class='$vuetify.theme.dark ? `text--darken-3` : `text--darken-4`') Rating
  138. //- .text-center
  139. //- v-rating(
  140. //- v-model='rating'
  141. //- color='yellow darken-3'
  142. //- background-color='grey lighten-1'
  143. //- half-increments
  144. //- hover
  145. //- )
  146. //- .caption.grey--text 5 votes
  147. v-card(flat)
  148. v-toolbar(:color='$vuetify.theme.dark ? `grey darken-4-d3` : `grey lighten-3`', flat, dense)
  149. v-spacer
  150. v-tooltip(bottom)
  151. template(v-slot:activator='{ on }')
  152. v-btn(icon, tile, v-on='on'): v-icon(color='grey') mdi-bookmark
  153. span {{$t('common:page.bookmark')}}
  154. v-menu(offset-y, bottom, min-width='300')
  155. template(v-slot:activator='{ on: menu }')
  156. v-tooltip(bottom)
  157. template(v-slot:activator='{ on: tooltip }')
  158. v-btn(icon, tile, v-on='{ ...menu, ...tooltip }'): v-icon(color='grey') mdi-share-variant
  159. span {{$t('common:page.share')}}
  160. social-sharing(
  161. :url='pageUrl'
  162. :title='title'
  163. :description='description'
  164. )
  165. v-tooltip(bottom)
  166. template(v-slot:activator='{ on }')
  167. v-btn(icon, tile, v-on='on', @click='print'): v-icon(color='grey') mdi-printer
  168. span {{$t('common:page.printFormat')}}
  169. v-spacer
  170. v-flex.page-col-content(xs12, lg9, xl10)
  171. v-tooltip(:right='$vuetify.rtl', :left='!$vuetify.rtl', v-if='hasAnyPagePermissions')
  172. template(v-slot:activator='{ on: onEditActivator }')
  173. v-speed-dial(
  174. v-model='pageEditFab'
  175. direction='top'
  176. open-on-hover
  177. transition='scale-transition'
  178. bottom
  179. :right='!$vuetify.rtl'
  180. :left='$vuetify.rtl'
  181. fixed
  182. dark
  183. )
  184. template(v-slot:activator)
  185. v-btn.btn-animate-edit(
  186. fab
  187. color='primary'
  188. v-model='pageEditFab'
  189. @click='pageEdit'
  190. v-on='onEditActivator'
  191. :disabled='!hasWritePagesPermission'
  192. )
  193. v-icon mdi-pencil
  194. v-tooltip(:right='$vuetify.rtl', :left='!$vuetify.rtl', v-if='hasReadHistoryPermission')
  195. template(v-slot:activator='{ on }')
  196. v-btn(
  197. fab
  198. small
  199. color='white'
  200. light
  201. v-on='on'
  202. @click='pageHistory'
  203. )
  204. v-icon(size='20') mdi-history
  205. span {{$t('common:header.history')}}
  206. v-tooltip(:right='$vuetify.rtl', :left='!$vuetify.rtl', v-if='hasReadSourcePermission')
  207. template(v-slot:activator='{ on }')
  208. v-btn(
  209. fab
  210. small
  211. color='white'
  212. light
  213. v-on='on'
  214. @click='pageSource'
  215. )
  216. v-icon(size='20') mdi-code-tags
  217. span {{$t('common:header.viewSource')}}
  218. v-tooltip(:right='$vuetify.rtl', :left='!$vuetify.rtl', v-if='hasWritePagesPermission')
  219. template(v-slot:activator='{ on }')
  220. v-btn(
  221. fab
  222. small
  223. color='white'
  224. light
  225. v-on='on'
  226. @click='pageDuplicate'
  227. )
  228. v-icon(size='20') mdi-content-duplicate
  229. span {{$t('common:header.duplicate')}}
  230. v-tooltip(:right='$vuetify.rtl', :left='!$vuetify.rtl', v-if='hasManagePagesPermission')
  231. template(v-slot:activator='{ on }')
  232. v-btn(
  233. fab
  234. small
  235. color='white'
  236. light
  237. v-on='on'
  238. @click='pageMove'
  239. )
  240. v-icon(size='20') mdi-content-save-move-outline
  241. span {{$t('common:header.move')}}
  242. v-tooltip(:right='$vuetify.rtl', :left='!$vuetify.rtl', v-if='hasDeletePagesPermission')
  243. template(v-slot:activator='{ on }')
  244. v-btn(
  245. fab
  246. dark
  247. small
  248. color='red'
  249. v-on='on'
  250. @click='pageDelete'
  251. )
  252. v-icon(size='20') mdi-trash-can-outline
  253. span {{$t('common:header.delete')}}
  254. span {{$t('common:page.editPage')}}
  255. v-alert.mb-5(v-if='!isPublished', color='red', outlined, icon='mdi-minus-circle', dense)
  256. .caption {{$t('common:page.unpublishedWarning')}}
  257. .contents(ref='container')
  258. slot(name='contents')
  259. .comments-container#discussion(v-if='commentsEnabled && commentsPerms.read')
  260. .comments-header
  261. v-icon.mr-2(dark) mdi-comment-text-outline
  262. span {{$t('common:comments.title')}}
  263. .comments-main
  264. slot(name='comments')
  265. nav-footer
  266. notify
  267. search-results
  268. v-fab-transition
  269. v-btn(
  270. v-if='upBtnShown'
  271. fab
  272. fixed
  273. bottom
  274. :right='$vuetify.rtl'
  275. :left='!$vuetify.rtl'
  276. small
  277. :depressed='this.$vuetify.breakpoint.mdAndUp'
  278. @click='$vuetify.goTo(0, scrollOpts)'
  279. color='primary'
  280. dark
  281. :style='upBtnPosition'
  282. )
  283. v-icon mdi-arrow-up
  284. </template>
  285. <script>
  286. import { StatusIndicator } from 'vue-status-indicator'
  287. import Tabset from './tabset.vue'
  288. import NavSidebar from './nav-sidebar.vue'
  289. import Prism from 'prismjs'
  290. import mermaid from 'mermaid'
  291. import { get } from 'vuex-pathify'
  292. import _ from 'lodash'
  293. import ClipboardJS from 'clipboard'
  294. import Vue from 'vue'
  295. Vue.component('tabset', Tabset)
  296. Prism.plugins.autoloader.languages_path = '/_assets/js/prism/'
  297. Prism.plugins.NormalizeWhitespace.setDefaults({
  298. 'remove-trailing': true,
  299. 'remove-indent': true,
  300. 'left-trim': true,
  301. 'right-trim': true,
  302. 'remove-initial-line-feed': true,
  303. 'tabs-to-spaces': 2
  304. })
  305. Prism.plugins.toolbar.registerButton('copy-to-clipboard', (env) => {
  306. let linkCopy = document.createElement('button')
  307. linkCopy.textContent = 'Copy'
  308. const clip = new ClipboardJS(linkCopy, {
  309. text: () => { return env.code }
  310. })
  311. clip.on('success', () => {
  312. linkCopy.textContent = 'Copied!'
  313. resetClipboardText()
  314. })
  315. clip.on('error', () => {
  316. linkCopy.textContent = 'Press Ctrl+C to copy'
  317. resetClipboardText()
  318. })
  319. return linkCopy
  320. function resetClipboardText() {
  321. setTimeout(() => {
  322. linkCopy.textContent = 'Copy'
  323. }, 5000)
  324. }
  325. })
  326. export default {
  327. components: {
  328. NavSidebar,
  329. StatusIndicator
  330. },
  331. props: {
  332. pageId: {
  333. type: Number,
  334. default: 0
  335. },
  336. locale: {
  337. type: String,
  338. default: 'en'
  339. },
  340. path: {
  341. type: String,
  342. default: 'home'
  343. },
  344. title: {
  345. type: String,
  346. default: 'Untitled Page'
  347. },
  348. description: {
  349. type: String,
  350. default: ''
  351. },
  352. createdAt: {
  353. type: String,
  354. default: ''
  355. },
  356. updatedAt: {
  357. type: String,
  358. default: ''
  359. },
  360. tags: {
  361. type: Array,
  362. default: () => ([])
  363. },
  364. authorName: {
  365. type: String,
  366. default: 'Unknown'
  367. },
  368. authorId: {
  369. type: Number,
  370. default: 0
  371. },
  372. isPublished: {
  373. type: Boolean,
  374. default: false
  375. },
  376. toc: {
  377. type: String,
  378. default: ''
  379. },
  380. sidebar: {
  381. type: String,
  382. default: ''
  383. },
  384. navMode: {
  385. type: String,
  386. default: 'MIXED'
  387. },
  388. commentsEnabled: {
  389. type: Boolean,
  390. default: false
  391. },
  392. effectivePermissions: {
  393. type: String,
  394. default: ''
  395. },
  396. commentsExternal: {
  397. type: Boolean,
  398. default: false
  399. }
  400. },
  401. data() {
  402. return {
  403. navShown: false,
  404. navExpanded: false,
  405. upBtnShown: false,
  406. pageEditFab: false,
  407. scrollOpts: {
  408. duration: 1500,
  409. offset: 0,
  410. easing: 'easeInOutCubic'
  411. },
  412. scrollStyle: {
  413. vuescroll: {},
  414. scrollPanel: {
  415. initialScrollX: 0.01, // fix scrollbar not disappearing on load
  416. scrollingX: false,
  417. speed: 50
  418. },
  419. rail: {
  420. gutterOfEnds: '2px'
  421. },
  422. bar: {
  423. onlyShowBarOnScroll: false,
  424. background: '#42A5F5',
  425. hoverStyle: {
  426. background: '#64B5F6'
  427. }
  428. }
  429. },
  430. winWidth: 0
  431. }
  432. },
  433. computed: {
  434. isAuthenticated: get('user/authenticated'),
  435. commentsCount: get('page/commentsCount'),
  436. commentsPerms: get('page/effectivePermissions@comments'),
  437. rating: {
  438. get () {
  439. return 3.5
  440. },
  441. set (val) {
  442. }
  443. },
  444. breadcrumbs() {
  445. return [{ path: '/', name: 'Home' }].concat(_.reduce(this.path.split('/'), (result, value, key) => {
  446. result.push({
  447. path: _.get(_.last(result), 'path', `/${this.locale}`) + `/${value}`,
  448. name: value
  449. })
  450. return result
  451. }, []))
  452. },
  453. pageUrl () { return window.location.href },
  454. upBtnPosition () {
  455. if (this.$vuetify.breakpoint.mdAndUp) {
  456. return this.$vuetify.rtl ? `right: 235px;` : `left: 235px;`
  457. } else {
  458. return this.$vuetify.rtl ? `right: 65px;` : `left: 65px;`
  459. }
  460. },
  461. sidebarDecoded () {
  462. return JSON.parse(Buffer.from(this.sidebar, 'base64').toString())
  463. },
  464. tocDecoded () {
  465. return JSON.parse(Buffer.from(this.toc, 'base64').toString())
  466. },
  467. hasAdminPermission: get('page/effectivePermissions@system.manage'),
  468. hasWritePagesPermission: get('page/effectivePermissions@pages.write'),
  469. hasManagePagesPermission: get('page/effectivePermissions@pages.manage'),
  470. hasDeletePagesPermission: get('page/effectivePermissions@pages.delete'),
  471. hasReadSourcePermission: get('page/effectivePermissions@source.read'),
  472. hasReadHistoryPermission: get('page/effectivePermissions@history.read'),
  473. hasAnyPagePermissions () {
  474. return this.hasAdminPermission || this.hasWritePagesPermission || this.hasManagePagesPermission ||
  475. this.hasDeletePagesPermission || this.hasReadSourcePermission || this.hasReadHistoryPermission
  476. }
  477. },
  478. created() {
  479. this.$store.set('page/authorId', this.authorId)
  480. this.$store.set('page/authorName', this.authorName)
  481. this.$store.set('page/createdAt', this.createdAt)
  482. this.$store.set('page/description', this.description)
  483. this.$store.set('page/isPublished', this.isPublished)
  484. this.$store.set('page/id', this.pageId)
  485. this.$store.set('page/locale', this.locale)
  486. this.$store.set('page/path', this.path)
  487. this.$store.set('page/tags', this.tags)
  488. this.$store.set('page/title', this.title)
  489. this.$store.set('page/updatedAt', this.updatedAt)
  490. if (this.effectivePermissions) {
  491. this.$store.set('page/effectivePermissions', JSON.parse(Buffer.from(this.effectivePermissions, 'base64').toString()))
  492. }
  493. this.$store.set('page/mode', 'view')
  494. },
  495. mounted () {
  496. if (this.$vuetify.theme.dark) {
  497. this.scrollStyle.bar.background = '#424242'
  498. }
  499. // -> Check side navigation visibility
  500. this.handleSideNavVisibility()
  501. window.addEventListener('resize', _.debounce(() => {
  502. this.handleSideNavVisibility()
  503. }, 500))
  504. // -> Highlight Code Blocks
  505. Prism.highlightAllUnder(this.$refs.container)
  506. // -> Render Mermaid diagrams
  507. mermaid.mermaidAPI.initialize({
  508. startOnLoad: true,
  509. theme: this.$vuetify.theme.dark ? `dark` : `default`
  510. })
  511. // -> Handle anchor scrolling
  512. if (window.location.hash && window.location.hash.length > 1) {
  513. if (document.readyState === 'complete') {
  514. this.$nextTick(() => {
  515. this.$vuetify.goTo(window.location.hash, this.scrollOpts)
  516. })
  517. } else {
  518. window.addEventListener('load', () => {
  519. this.$vuetify.goTo(window.location.hash, this.scrollOpts)
  520. })
  521. }
  522. }
  523. // -> Handle anchor links within the page contents
  524. this.$nextTick(() => {
  525. this.$refs.container.querySelectorAll(`a[href^="#"], a[href^="${window.location.href.replace(window.location.hash, '')}#"]`).forEach(el => {
  526. el.onclick = ev => {
  527. ev.preventDefault()
  528. ev.stopPropagation()
  529. this.$vuetify.goTo(decodeURIComponent(ev.target.hash), this.scrollOpts)
  530. }
  531. })
  532. })
  533. },
  534. methods: {
  535. goHome () {
  536. window.location.assign('/')
  537. },
  538. toggleNavigation () {
  539. this.navOpen = !this.navOpen
  540. },
  541. upBtnScroll () {
  542. const scrollOffset = window.pageYOffset || document.documentElement.scrollTop
  543. this.upBtnShown = scrollOffset > window.innerHeight * 0.33
  544. },
  545. print () {
  546. window.print()
  547. },
  548. pageEdit () {
  549. this.$root.$emit('pageEdit')
  550. },
  551. pageHistory () {
  552. this.$root.$emit('pageHistory')
  553. },
  554. pageSource () {
  555. this.$root.$emit('pageSource')
  556. },
  557. pageDuplicate () {
  558. this.$root.$emit('pageDuplicate')
  559. },
  560. pageMove () {
  561. this.$root.$emit('pageMove')
  562. },
  563. pageDelete () {
  564. this.$root.$emit('pageDelete')
  565. },
  566. handleSideNavVisibility () {
  567. if (window.innerWidth === this.winWidth) { return }
  568. this.winWidth = window.innerWidth
  569. if (this.$vuetify.breakpoint.mdAndUp) {
  570. this.navShown = true
  571. } else {
  572. this.navShown = false
  573. }
  574. },
  575. goToComments (focusNewComment = false) {
  576. this.$vuetify.goTo('#discussion', this.scrollOpts)
  577. if (focusNewComment) {
  578. document.querySelector('#discussion-new').focus()
  579. }
  580. }
  581. }
  582. }
  583. </script>
  584. <style lang="scss">
  585. .breadcrumbs-nav {
  586. .v-btn {
  587. min-width: 0;
  588. &__content {
  589. text-transform: none;
  590. }
  591. }
  592. .v-breadcrumbs__divider:nth-child(2n) {
  593. padding: 0 6px;
  594. }
  595. .v-breadcrumbs__divider:nth-child(2) {
  596. padding: 0 6px 0 12px;
  597. }
  598. }
  599. .page-col-sd {
  600. margin-top: -90px;
  601. align-self: flex-start;
  602. position: sticky;
  603. top: 64px;
  604. max-height: calc(100vh - 64px);
  605. overflow-y: auto;
  606. -ms-overflow-style: none;
  607. }
  608. .page-col-sd::-webkit-scrollbar {
  609. display: none;
  610. }
  611. </style>