Skip to content

Commit

Permalink
use Actions and ActionButton components
Browse files Browse the repository at this point in the history
  • Loading branch information
korelstar committed Mar 13, 2022
1 parent 9d9833a commit 9482695
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions src/components/EditorEasyMDE.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
<template>
<div>
<div class="upload-button">
<button class="icon-upload" @click="onClickUpload" />
<button class="icon-files" @click="onClickSelect" />
<Actions
container=".upload-button"
menu-align="right"
default-icon="icon-picture"
>
<ActionButton
icon="icon-upload"
@click="onClickUpload"
:closeAfterClick="true"
>
{{ t('notes', 'Upload image') }}
</ActionButton>
<ActionButton
icon="icon-picture"
@click="onClickSelect"
:closeAfterClick="true"
>
{{ t('notes', 'Insert image') }}
</ActionButton>
</Actions>
</div>
<div class="markdown-editor" @click="onClickEditor">
<textarea />
Expand All @@ -17,10 +35,19 @@ import { generateUrl } from '@nextcloud/router'
import store from '../store'
import { showError } from '@nextcloud/dialogs'
import '@nextcloud/dialogs/styles/toast.scss'
import {
Actions,
ActionButton,
} from '@nextcloud/vue'
export default {
name: 'EditorEasyMDE',
components: {
Actions,
ActionButton,
},
props: {
value: {
type: String,
Expand Down Expand Up @@ -337,13 +364,8 @@ export default {
}
.upload-button {
margin-right: 15px;
right: 64px;
position: fixed;
height: 40px;
}
.upload-button button {
height: 100%;
width: 40px;
}
</style>

0 comments on commit 9482695

Please sign in to comment.