Improve custom emoji managemant

This commit is contained in:
syuilo
2020-02-14 01:09:39 +09:00
parent 5ac4c48ad1
commit f5f7654f4b
5 changed files with 86 additions and 81 deletions

View File

@ -1,8 +1,8 @@
import { faUpload, faCloud, faLink } from '@fortawesome/free-solid-svg-icons';
import { faUpload, faCloud } from '@fortawesome/free-solid-svg-icons';
import { selectDriveFile } from './select-drive-file';
import { apiUrl } from '../config';
export function selectFile(component: any, src: any, label: string, multiple = false) {
export function selectFile(component: any, src: any, label: string | null, multiple = false) {
return new Promise((res, rej) => {
const chooseFileFromPc = () => {
const input = document.createElement('input');
@ -56,10 +56,10 @@ export function selectFile(component: any, src: any, label: string, multiple = f
};
component.$root.menu({
items: [{
items: [label ? {
text: label,
type: 'label'
}, {
} : undefined, {
text: component.$t('upload'),
icon: faUpload,
action: chooseFileFromPc