Removed option & logic for setting orientation

refs https://github.com/TryGhost/Team/issues/1249

Based on design feedback from Djordje & Zimo.
This commit is contained in:
Fabien egg O'Carroll 2021-12-14 18:37:43 +02:00
parent 3742502f2d
commit 1a772b13c1

View File

@ -20,33 +20,14 @@ export default class KoenigCardBeforeAfterComponent extends Component {
}
get overlayStyle() {
if (this.args.payload.orientation === 'horizontal') {
return `width: ${this.args.payload.startingPosition}%`;
}
if (this.args.payload.orientation === 'vertical') {
return `height: ${this.args.payload.startingPosition}%`;
}
return null;
return `width: ${this.args.payload.startingPosition}%`;
}
get toolbar() {
let cardWidth = this.args.payload.cardWidth;
let orientation = this.args.payload.orientation;
return {
items: [{
title: 'Horizontal',
icon: 'koenig/kg-heading-1',
iconClass: orientation === 'horizontal' ? 'fill-green-l2' : 'fill-white',
action: run.bind(this, this.setOrientationHorizontal)
}, {
title: 'Vertical',
icon: 'koenig/kg-heading-2',
iconClass: orientation === 'vertical' ? 'fill-green-l2' : 'fill-white',
action: run.bind(this, this.setOrientationVertical)
}, {
divider: true
}, {
title: 'Wide',
icon: 'koenig/kg-img-wide',
iconClass: cardWidth === 'wide' ? 'fill-green-l2' : 'fill-white',
@ -90,9 +71,6 @@ export default class KoenigCardBeforeAfterComponent extends Component {
let placeholders = ['summer', 'mountains', 'ufo-attack'];
this.placeholder = placeholders[Math.floor(Math.random() * placeholders.length)];
if (!args.payload.orientation) {
args.payload.orientation = 'horizontal';
}
if (!args.payload.cardWidth) {
args.payload.cardWidth = 'wide';
}
@ -204,16 +182,6 @@ export default class KoenigCardBeforeAfterComponent extends Component {
run.scheduleOnce('afterRender', this, this.updateImageDimensions);
}
@action
setOrientationHorizontal() {
this.args.payload.orientation = 'horizontal';
}
@action
setOrientationVertical() {
this.args.payload.orientation = 'vertical';
}
@action
setStartingPosition(event) {
this.args.payload.startingPosition = Math.min(100, Math.max(0, parseInt(event.target.value)));