Browse Source

feat: drag n drop button disable

pull/7619/head
Ruslan Semak 2 months ago
parent
commit
0a57bfd2fe
1 changed files with 4 additions and 0 deletions
  1. 4
      client/components/admin/admin-pages.vue

4
client/components/admin/admin-pages.vue

@ -61,6 +61,7 @@
) )
v-btn.ml-2( v-btn.ml-2(
color='primary' color='primary'
:disabled='!dragged'
depressed depressed
@click='saveNewOrder' @click='saveNewOrder'
) )
@ -140,6 +141,7 @@ export default {
], ],
groups: [], groups: [],
loading: false, loading: false,
dragged: false,
draggedItem: null, draggedItem: null,
draggedIndex: null, draggedIndex: null,
dragOverIndex: null dragOverIndex: null
@ -197,6 +199,7 @@ export default {
icon: 'check' icon: 'check'
}) })
this.dragged = false
await this.refresh() await this.refresh()
} catch (error) { } catch (error) {
this.$store.commit('showNotification', { this.$store.commit('showNotification', {
@ -243,6 +246,7 @@ export default {
drop(event, item, index) { drop(event, item, index) {
event.preventDefault() event.preventDefault()
this.dragOverIndex = null this.dragOverIndex = null
this.dragged = true
if (!this.draggedItem || this.draggedItem.id === item.id) { if (!this.draggedItem || this.draggedItem.id === item.id) {
return return

Loading…
Cancel
Save