Skip to content

Commit d5d3f49

Browse files
committed
switch to actions component from nc-vue
1 parent 4a3aef6 commit d5d3f49

File tree

1 file changed

+37
-28
lines changed

1 file changed

+37
-28
lines changed

src/components/Note.vue

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,42 @@
1616
class="icon-error-color"
1717
@click="onManualSave"
1818
/>
19-
<button v-show="actionsOpen && !fullscreen"
20-
v-tooltip="t('notes', 'Toggle sidebar')"
21-
class="icon-details"
22-
@click="onToggleSidebar"
23-
/>
24-
<button v-show="actionsOpen"
25-
v-tooltip="t('notes', 'Toggle preview')"
26-
class="icon-toggle"
27-
:class="{ active: preview }"
28-
@click="onTogglePreview"
29-
/>
30-
<button v-show="actionsOpen"
31-
v-tooltip="t('notes', 'Toggle fullscreen mode')"
32-
class="icon-fullscreen"
33-
:class="{ active: fullscreen }"
34-
@click="onToggleDistractionFree"
35-
/>
36-
<button
37-
v-tooltip="t('notes', 'Toggle action menu')"
38-
class="icon-more"
39-
:class="{ active: actionsOpen }"
40-
@click="onToggleActions"
41-
/>
19+
<Actions :open.sync="actionsOpen" menuAlign="right">
20+
<ActionButton v-show="!sidebarOpen && !fullscreen"
21+
icon="icon-details"
22+
@click="onToggleSidebar"
23+
>
24+
{{ t('notes', 'Show sidebar') }}
25+
</ActionButton>
26+
<ActionButton v-show="!preview"
27+
icon="icon-toggle"
28+
@click="onTogglePreview"
29+
>
30+
{{ t('notes', 'Show preview') }}
31+
</ActionButton>
32+
<ActionButton v-show="preview"
33+
icon="icon-rename"
34+
@click="onTogglePreview"
35+
>
36+
{{ t('notes', 'Edit note') }}
37+
</ActionButton>
38+
<ActionButton
39+
icon="icon-fullscreen"
40+
:class="{ active: fullscreen }"
41+
@click="onToggleDistractionFree"
42+
>
43+
{{ t('notes', 'Fullscreen mode') }}
44+
</ActionButton>
45+
</Actions>
4246
</span>
4347
</div>
4448
</AppContent>
4549
</template>
4650
<script>
4751
4852
import {
53+
Actions,
54+
ActionButton,
4955
AppContent,
5056
Tooltip,
5157
} from 'nextcloud-vue'
@@ -58,6 +64,8 @@ export default {
5864
name: 'Note',
5965
6066
components: {
67+
Actions,
68+
ActionButton,
6169
AppContent,
6270
TheEditor,
6371
ThePreview,
@@ -191,10 +199,6 @@ export default {
191199
this.actionsOpen = false
192200
},
193201
194-
onToggleActions() {
195-
this.actionsOpen = !this.actionsOpen
196-
},
197-
198202
onEdit(newContent) {
199203
if (this.note.content !== newContent) {
200204
const note = {
@@ -274,11 +278,16 @@ export default {
274278
/* main editor button */
275279
.action-buttons {
276280
position: fixed;
277-
bottom: 4px;
281+
top: 50px;
278282
right: 20px;
283+
margin-top: 1em;
279284
z-index: 2000;
280285
}
281286
287+
.note-container.fullscreen .action-buttons {
288+
top: 0px;
289+
}
290+
282291
.action-buttons button {
283292
padding: 15px;
284293
}

0 commit comments

Comments
 (0)