mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
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:
parent
3742502f2d
commit
1a772b13c1
1 changed files with 1 additions and 33 deletions
|
@ -20,33 +20,14 @@ export default class KoenigCardBeforeAfterComponent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
get overlayStyle() {
|
get overlayStyle() {
|
||||||
if (this.args.payload.orientation === 'horizontal') {
|
return `width: ${this.args.payload.startingPosition}%`;
|
||||||
return `width: ${this.args.payload.startingPosition}%`;
|
|
||||||
}
|
|
||||||
if (this.args.payload.orientation === 'vertical') {
|
|
||||||
return `height: ${this.args.payload.startingPosition}%`;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get toolbar() {
|
get toolbar() {
|
||||||
let cardWidth = this.args.payload.cardWidth;
|
let cardWidth = this.args.payload.cardWidth;
|
||||||
let orientation = this.args.payload.orientation;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
items: [{
|
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',
|
title: 'Wide',
|
||||||
icon: 'koenig/kg-img-wide',
|
icon: 'koenig/kg-img-wide',
|
||||||
iconClass: cardWidth === 'wide' ? 'fill-green-l2' : 'fill-white',
|
iconClass: cardWidth === 'wide' ? 'fill-green-l2' : 'fill-white',
|
||||||
|
@ -90,9 +71,6 @@ export default class KoenigCardBeforeAfterComponent extends Component {
|
||||||
|
|
||||||
let placeholders = ['summer', 'mountains', 'ufo-attack'];
|
let placeholders = ['summer', 'mountains', 'ufo-attack'];
|
||||||
this.placeholder = placeholders[Math.floor(Math.random() * placeholders.length)];
|
this.placeholder = placeholders[Math.floor(Math.random() * placeholders.length)];
|
||||||
if (!args.payload.orientation) {
|
|
||||||
args.payload.orientation = 'horizontal';
|
|
||||||
}
|
|
||||||
if (!args.payload.cardWidth) {
|
if (!args.payload.cardWidth) {
|
||||||
args.payload.cardWidth = 'wide';
|
args.payload.cardWidth = 'wide';
|
||||||
}
|
}
|
||||||
|
@ -204,16 +182,6 @@ export default class KoenigCardBeforeAfterComponent extends Component {
|
||||||
run.scheduleOnce('afterRender', this, this.updateImageDimensions);
|
run.scheduleOnce('afterRender', this, this.updateImageDimensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
|
||||||
setOrientationHorizontal() {
|
|
||||||
this.args.payload.orientation = 'horizontal';
|
|
||||||
}
|
|
||||||
|
|
||||||
@action
|
|
||||||
setOrientationVertical() {
|
|
||||||
this.args.payload.orientation = 'vertical';
|
|
||||||
}
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
setStartingPosition(event) {
|
setStartingPosition(event) {
|
||||||
this.args.payload.startingPosition = Math.min(100, Math.max(0, parseInt(event.target.value)));
|
this.args.payload.startingPosition = Math.min(100, Math.max(0, parseInt(event.target.value)));
|
||||||
|
|
Loading…
Add table
Reference in a new issue