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