22 <div id =" app-dashboard" >
33 <h2 >{{ greeting.icon }} {{ greeting.text }}</h2 >
44
5- <Container class =" panels"
6- orientation =" horizontal"
7- drag-handle-selector =" .panel--header"
8- @drop =" onDrop" >
9- <Draggable v-for =" panelId in layout" :key =" panels[panelId].id" class =" panel" >
5+ <Draggable class =" panels" v-model =" layout" >
6+ <div v-for =" panelId in layout" :key =" panels[panelId].id" class =" panel" >
107 <div class =" panel--header" >
11- <a :href =" panels[panelId].url" >
12- <h3 :class =" panels[panelId].iconClass" >
13- {{ panels[panelId].title }}
14- </h3 >
15- </a >
8+ <h3 :class =" panels[panelId].iconClass" >
9+ {{ panels[panelId].title }}
10+ </h3 >
1611 </div >
1712 <div class =" panel--content" >
1813 <div :ref =" panels[panelId].id" :data-id =" panels[panelId].id" />
1914 </div >
20- </Draggable >
21- </Container >
15+ </div >
16+ </Draggable >
2217 <a class =" edit-panels icon-add" @click =" showModal" >{{ t('dashboard', 'Edit panels') }}</a >
2318 <Modal v-if =" modal" @close =" closeModal" >
2419 <div class =" modal__content" >
3025 class =" checkbox"
3126 :checked =" isActive(panel)"
3227 @input =" updateCheckbox(panel, $event.target.checked)" >
33- <label :for =" 'panel-checkbox-' + panel.id" >
28+ <label :for =" 'panel-checkbox-' + panel.id" :class = " panel.iconClass " >
3429 {{ panel.title }}
3530 </label >
3631 </li >
@@ -48,7 +43,7 @@ import Vue from 'vue'
4843import { loadState } from ' @nextcloud/initial-state'
4944import { getCurrentUser } from ' @nextcloud/auth'
5045import { Modal } from ' @nextcloud/vue'
51- import { Container , Draggable } from ' vue-smooth-dnd '
46+ import Draggable from ' vuedraggable '
5247import axios from ' @nextcloud/axios'
5348import { generateUrl } from ' @nextcloud/router'
5449
@@ -76,7 +71,6 @@ export default {
7671 name: ' App' ,
7772 components: {
7873 Modal,
79- Container,
8074 Draggable,
8175 },
8276 data () {
@@ -216,6 +210,10 @@ export default {
216210 border-radius : var (--border-radius-large );
217211 border : 2px solid var (--color-border );
218212
213+ & .sortable-ghost {
214+ opacity : 0.1 ;
215+ }
216+
219217 & > .panel--header {
220218 position : sticky ;
221219 display : flex ;
@@ -229,6 +227,15 @@ export default {
229227 backdrop-filter : blur (4px );
230228 cursor : grab ;
231229
230+ & , ::v- deep * {
231+ -webkit-touch-callout : none ;
232+ -webkit-user-select : none ;
233+ -khtml-user-select : none ;
234+ -moz-user-select : none ;
235+ -ms-user-select : none ;
236+ user-select : none ;
237+ }
238+
232239 & :active {
233240 cursor : grabbing ;
234241 }
@@ -282,6 +289,9 @@ export default {
282289 padding : 10px ;
283290 display : block ;
284291 list-style-type : none ;
292+ background-size : 16px ;
293+ background-position : left center ;
294+ padding-left : 26px ;
285295 }
286296 }
287297
0 commit comments