mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Added transparency grid and event tracking to Image Editor (#16959)
This commit is contained in:
parent
9da246ac84
commit
c4629e0118
@ -1,4 +1,5 @@
|
||||
import Component from '@glimmer/component';
|
||||
import trackEvent from '../utils/analytics';
|
||||
import {action} from '@ember/object';
|
||||
import {inject} from 'ghost-admin/decorators/inject';
|
||||
import {inject as service} from '@ember/service';
|
||||
@ -144,10 +145,11 @@ export default class KoenigImageEditor extends Component {
|
||||
if (!imageUrl.searchParams.has('v')) {
|
||||
imageUrl.searchParams.set('v', Date.now());
|
||||
}
|
||||
|
||||
trackEvent('Image Edit Button Clicked', {location: 'admin'});
|
||||
const imageSrc = imageUrl.href;
|
||||
const editor = window.pintura.openDefaultEditor({
|
||||
src: imageSrc,
|
||||
enableTransparencyGrid: true,
|
||||
util: 'crop',
|
||||
utils: [
|
||||
'crop',
|
||||
@ -214,6 +216,7 @@ export default class KoenigImageEditor extends Component {
|
||||
if (this.args.saveUrl) {
|
||||
uploader.setFiles([result.dest]);
|
||||
}
|
||||
trackEvent('Image Edit Saved', {location: 'admin'});
|
||||
} catch (e) {
|
||||
// Failed to save edited image
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user