mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Allowed creating audio card directly on file drop in editor
refs https://github.com/TryGhost/Team/issues/1230
This commit is contained in:
parent
192c983975
commit
997862cf58
2 changed files with 7 additions and 3 deletions
|
@ -56,8 +56,8 @@ export default class KoenigCardAudioComponent extends Component {
|
|||
}
|
||||
|
||||
get isIncomplete() {
|
||||
const {src, thumbnailSrc} = this.args.payload;
|
||||
return isBlank(src) || isBlank(thumbnailSrc);
|
||||
const {src} = this.args.payload;
|
||||
return isBlank(src);
|
||||
}
|
||||
|
||||
get toolbar() {
|
||||
|
|
|
@ -73,7 +73,7 @@ export function insertCardsFromFiles(_files, postEditor) {
|
|||
}
|
||||
|
||||
function filterAllowedFiles(files) {
|
||||
return Array.from(files).filter(file => file.type.match(/^(image|video)/));
|
||||
return Array.from(files).filter(file => file.type.match(/^(image|video|audio)/));
|
||||
}
|
||||
|
||||
function getCardNameFromFile(file) {
|
||||
|
@ -84,4 +84,8 @@ function getCardNameFromFile(file) {
|
|||
if (file.type.startsWith('video')) {
|
||||
return 'video';
|
||||
}
|
||||
|
||||
if (file.type.startsWith('audio')) {
|
||||
return 'audio';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue