mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-04 17:04:59 +03:00
28 lines
657 B
JavaScript
28 lines
657 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
|
||
|
update(value) {
|
||
|
this.settings.set('logo', value);
|
||
|
this.args.didUpdate('logo', value);
|
||
|
}
|
||
|
}
|