mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
6c131de6eb
refs https://github.com/TryGhost/Team/issues/3145 - adds image editing functionality(behind flag) using pintura integration to publication logo and cover
33 lines
738 B
JavaScript
33 lines
738 B
JavaScript
import Component from '@glimmer/component';
|
|
import {
|
|
IMAGE_EXTENSIONS,
|
|
IMAGE_MIME_TYPES
|
|
} from 'ghost-admin/components/gh-image-uploader';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class PublicationLogoFormField extends Component {
|
|
@service settings;
|
|
|
|
imageExtensions = IMAGE_EXTENSIONS;
|
|
imageMimeTypes = IMAGE_MIME_TYPES;
|
|
|
|
@action
|
|
imageUploaded(results) {
|
|
if (results[0]) {
|
|
this.update(results[0].url);
|
|
}
|
|
}
|
|
|
|
@action
|
|
saveImage(setFiles, imageFile) {
|
|
setFiles([imageFile]);
|
|
}
|
|
|
|
@action
|
|
update(value) {
|
|
this.settings.logo = value;
|
|
this.args.didUpdate('logo', value);
|
|
}
|
|
}
|