From 1a772b13c1acd7524efa723d2256227b886c5424 Mon Sep 17 00:00:00 2001 From: Fabien egg O'Carroll Date: Tue, 14 Dec 2021 18:37:43 +0200 Subject: [PATCH] Removed option & logic for setting orientation refs https://github.com/TryGhost/Team/issues/1249 Based on design feedback from Djordje & Zimo. --- .../components/koenig-card-before-after.js | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/ghost/admin/lib/koenig-editor/addon/components/koenig-card-before-after.js b/ghost/admin/lib/koenig-editor/addon/components/koenig-card-before-after.js index 06b39c54f4..2ca5f012fd 100644 --- a/ghost/admin/lib/koenig-editor/addon/components/koenig-card-before-after.js +++ b/ghost/admin/lib/koenig-editor/addon/components/koenig-card-before-after.js @@ -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)));