Skip to content

Commit 6f2369e

Browse files
committed
UX: make placeholder in template notes sortable
1 parent 056d12e commit 6f2369e

File tree

4 files changed

+28
-21
lines changed

4 files changed

+28
-21
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ For detailed explanation on how things work, check out [Nuxt.js docs](https://nu
6565
## Changelog
6666

6767
### 0.9.17
68+
* UX: make placeholder in template notes sortable
6869
* abort creation/edit of note while typing [ESC]
6970
* autofocus the first text element on copy dialog for template notes
7071
* fix crash when try to create new placeholder

components/note/form/Template.vue

+24-15
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,28 @@
99

1010
<v-list dense v-if="note.placeholder.length > 0">
1111
<v-subheader class="pa-0">{{$t('note.template.placeholder.title')}}</v-subheader>
12-
<v-list-item v-for="placeholder of note.placeholder" :key="placeholder.id" class="pa-0">
13-
<v-list-item-content>
14-
<v-list-item-title>
15-
<v-btn block @click="insertPlaceholder(placeholder.name)" >{{placeholder.name}}</v-btn>
16-
</v-list-item-title>
17-
</v-list-item-content>
12+
<draggable v-model="note.placeholder" handle=".handle">
13+
<v-list-item v-for="placeholder of note.placeholder" :key="placeholder.id" class="pa-0">
14+
<v-list-item-content>
15+
<v-list-item-title>
16+
<v-btn block @click="insertPlaceholder(placeholder.name)">{{placeholder.name}}
17+
</v-btn>
18+
</v-list-item-title>
19+
</v-list-item-content>
1820

19-
<v-list-item-icon>
20-
<v-btn icon class="error mr-2" @click="deletePlaceholder(placeholder.id)">
21-
<v-icon>delete</v-icon>
22-
</v-btn>
23-
<v-btn icon class="primary" @click="editPlaceholder(placeholder)">
24-
<v-icon>edit</v-icon>
25-
</v-btn>
26-
</v-list-item-icon>
27-
</v-list-item>
21+
<v-list-item-icon>
22+
<v-btn icon class="handle mr-2">
23+
<v-icon>drag_indicator</v-icon>
24+
</v-btn>
25+
<v-btn icon class="error mr-2" @click="deletePlaceholder(placeholder.id)">
26+
<v-icon>delete</v-icon>
27+
</v-btn>
28+
<v-btn icon class="primary" @click="editPlaceholder(placeholder)">
29+
<v-icon>edit</v-icon>
30+
</v-btn>
31+
</v-list-item-icon>
32+
</v-list-item>
33+
</draggable>
2834
</v-list>
2935

3036
<v-row>
@@ -411,4 +417,7 @@
411417
</script>
412418

413419
<style scoped>
420+
.handle {
421+
cursor: grab;
422+
}
414423
</style>

nuxt.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default {
8080
plugins: [
8181
'~/plugins/localStore',
8282
'~/plugins/i18n',
83-
'~/plugins/shortkey',
83+
'~/plugins/globalComponents',
8484
'~/plugins/init',
8585
'~/plugins/style',
8686
'~/plugins/notification',
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import Vue from 'vue'
2-
32
import shortkey from 'vue-shortkey'
3+
import draggable from 'vuedraggable'
44

55
Vue.use(shortkey)
6-
7-
export default ({ app, store }) => {
8-
9-
}
6+
Vue.component('draggable', draggable)

0 commit comments

Comments
 (0)