page.vue 22 KB

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