You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

679 lines
24 KiB

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