fix: page selector scroll
This commit is contained in:
		| @@ -18,43 +18,47 @@ | |||||||
|           :width='2' |           :width='2' | ||||||
|           v-show='searchLoading' |           v-show='searchLoading' | ||||||
|           ) |           ) | ||||||
|       .d-flex(style='min-height:400px;') |       .d-flex | ||||||
|         v-flex.grey(xs5, :class='darkMode ? `darken-4` : `lighten-3`') |         v-flex.grey(xs5, :class='darkMode ? `darken-4` : `lighten-3`') | ||||||
|           v-toolbar(color='grey darken-3', dark, dense, flat) |           v-toolbar(color='grey darken-3', dark, dense, flat) | ||||||
|             .body-2 Virtual Folders |             .body-2 Virtual Folders | ||||||
|             v-spacer |             v-spacer | ||||||
|             v-btn(icon, tile, href='https://docs.requarks.io/guide/pages#folders', target='_blank') |             v-btn(icon, tile, href='https://docs.requarks.io/guide/pages#folders', target='_blank') | ||||||
|               v-icon mdi-help-box |               v-icon mdi-help-box | ||||||
|           v-treeview( |           div(style='height:400px;') | ||||||
|             :active.sync='currentNode' |             vue-scroll(:ops='scrollStyle') | ||||||
|             :open.sync='openNodes' |               v-treeview( | ||||||
|             :items='tree' |                 :active.sync='currentNode' | ||||||
|             :load-children='fetchFolders' |                 :open.sync='openNodes' | ||||||
|             dense |                 :items='tree' | ||||||
|             expand-icon='mdi-menu-down-outline' |                 :load-children='fetchFolders' | ||||||
|             item-id='path' |                 dense | ||||||
|             item-text='title' |                 expand-icon='mdi-menu-down-outline' | ||||||
|             activatable |                 item-id='path' | ||||||
|             hoverable |                 item-text='title' | ||||||
|             ) |                 activatable | ||||||
|             template(slot='prepend', slot-scope='{ item, open, leaf }') |                 hoverable | ||||||
|               v-icon mdi-{{ open ? 'folder-open' : 'folder' }} |                 ) | ||||||
|  |                 template(slot='prepend', slot-scope='{ item, open, leaf }') | ||||||
|  |                   v-icon mdi-{{ open ? 'folder-open' : 'folder' }} | ||||||
|         v-flex(xs7) |         v-flex(xs7) | ||||||
|           v-toolbar(color='blue darken-2', dark, dense, flat) |           v-toolbar(color='blue darken-2', dark, dense, flat) | ||||||
|             .body-2 Pages |             .body-2 Pages | ||||||
|             v-spacer |             v-spacer | ||||||
|             v-btn(icon, tile, disabled): v-icon mdi-content-save-move-outline |             v-btn(icon, tile, disabled): v-icon mdi-content-save-move-outline | ||||||
|             v-btn(icon, tile, disabled): v-icon mdi-trash-can-outline |             v-btn(icon, tile, disabled): v-icon mdi-trash-can-outline | ||||||
|           v-list.py-0(dense, v-if='currentPages.length > 0') |           div(v-if='currentPages.length > 0', style='height:400px;') | ||||||
|             v-list-item-group( |             vue-scroll(:ops='scrollStyle') | ||||||
|               v-model='currentPage' |               v-list.py-0(dense) | ||||||
|               color='primary' |                 v-list-item-group( | ||||||
|               ) |                   v-model='currentPage' | ||||||
|               template(v-for='(page, idx) of currentPages') |                   color='primary' | ||||||
|                 v-list-item(:key='page.id', :value='page.path') |                   ) | ||||||
|                   v-list-item-icon: v-icon mdi-file-document-box |                   template(v-for='(page, idx) of currentPages') | ||||||
|                   v-list-item-title {{page.title}} |                     v-list-item(:key='page.id', :value='page.path') | ||||||
|                 v-divider(v-if='idx < pages.length - 1') |                       v-list-item-icon: v-icon mdi-file-document-box | ||||||
|  |                       v-list-item-title {{page.title}} | ||||||
|  |                     v-divider(v-if='idx < pages.length - 1') | ||||||
|           v-alert.animated.fadeIn( |           v-alert.animated.fadeIn( | ||||||
|             v-else |             v-else | ||||||
|             text |             text | ||||||
| @@ -134,14 +138,34 @@ export default { | |||||||
|       currentPage: null, |       currentPage: null, | ||||||
|       currentNode: [0], |       currentNode: [0], | ||||||
|       openNodes: [0], |       openNodes: [0], | ||||||
|       tree: [{ |       tree: [ | ||||||
|         id: 0, |         { | ||||||
|         title: '/ (root', |           id: 0, | ||||||
|         children: [] |           title: '/ (root', | ||||||
|       }], |           children: [] | ||||||
|  |         } | ||||||
|  |       ], | ||||||
|       pages: [], |       pages: [], | ||||||
|       all: [], |       all: [], | ||||||
|       namespaces: siteLangs.length ? siteLangs.map(ns => ns.code) : [siteConfig.lang] |       namespaces: siteLangs.length ? siteLangs.map(ns => ns.code) : [siteConfig.lang], | ||||||
|  |       scrollStyle: { | ||||||
|  |         vuescroll: {}, | ||||||
|  |         scrollPanel: { | ||||||
|  |           initialScrollX: 0.01, // fix scrollbar not disappearing on load | ||||||
|  |           scrollingX: false, | ||||||
|  |           speed: 50 | ||||||
|  |         }, | ||||||
|  |         rail: { | ||||||
|  |           gutterOfEnds: '2px' | ||||||
|  |         }, | ||||||
|  |         bar: { | ||||||
|  |           onlyShowBarOnScroll: false, | ||||||
|  |           background: '#999', | ||||||
|  |           hoverStyle: { | ||||||
|  |             background: '#64B5F6' | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   computed: { |   computed: { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user