0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Renamed buttonAlignment to alignment in email-cta payload

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

- all contents within an email-cta card are now aligned left/center so it doesn't make sense to keep the payload attribute as `buttonAlignment`
This commit is contained in:
Kevin Ansfield 2021-08-24 17:53:34 +01:00
parent dff28b3ca6
commit a6ca133915
2 changed files with 7 additions and 7 deletions

View file

@ -46,7 +46,7 @@
{{#if @payload.showDividers}}<hr class="border-top edit-mode">{{/if}} {{#if @payload.showDividers}}<hr class="border-top edit-mode">{{/if}}
<div class="{{if (eq @payload.buttonAlignment "center") "tc"}}"> <div class="{{if (eq @payload.alignment "center") "tc"}}">
<KoenigTextReplacementHtmlInput <KoenigTextReplacementHtmlInput
@html={{@payload.html}} @html={{@payload.html}}
@placeholder="Email only text... (optional)" @placeholder="Email only text... (optional)"
@ -77,8 +77,8 @@
</div> </div>
<div class="gh-btn-group icons email-cta-align"> <div class="gh-btn-group icons email-cta-align">
<button type="button" title="Left-align content" class="gh-btn gh-btn-icon {{if (eq @payload.buttonAlignment "left") "gh-btn-group-selected"}}" {{on "click" (fn this.setButtonAlignment "left")}}><span>{{svg-jar "align-left"}}</span></button> <button type="button" title="Left-align content" class="gh-btn gh-btn-icon {{if (eq @payload.alignment "left") "gh-btn-group-selected"}}" {{on "click" (fn this.setAlignment "left")}}><span>{{svg-jar "align-left"}}</span></button>
<button type="button" title="Center-align content" class="gh-btn gh-btn-icon {{if (eq @payload.buttonAlignment "center") "gh-btn-group-selected"}}" {{on "click" (fn this.setButtonAlignment "center")}}><span>{{svg-jar "align-center"}}</span></button> <button type="button" title="Center-align content" class="gh-btn gh-btn-icon {{if (eq @payload.alignment "center") "gh-btn-group-selected"}}" {{on "click" (fn this.setAlignment "center")}}><span>{{svg-jar "align-center"}}</span></button>
</div> </div>
<button type="button" title="Add button" class="gh-btn gh-btn-white gh-btn-icon email-cta-toolbar-item {{if @payload.showButton "fill-green-l2"}}" {{on "click" this.toggleButton}}><span>{{svg-jar "button"}}</span></button> <button type="button" title="Add button" class="gh-btn gh-btn-white gh-btn-icon email-cta-toolbar-item {{if @payload.showButton "fill-green-l2"}}" {{on "click" this.toggleButton}}><span>{{svg-jar "button"}}</span></button>
@ -125,7 +125,7 @@
{{#if @payload.showDividers}}<hr class="border-top">{{/if}} {{#if @payload.showDividers}}<hr class="border-top">{{/if}}
<div class="{{if (not @payload.showDividers) "pb2"}} {{if (eq @payload.buttonAlignment "center") "tc"}}"> <div class="{{if (not @payload.showDividers) "pb2"}} {{if (eq @payload.alignment "center") "tc"}}">
{{#if @payload.html}} {{#if @payload.html}}
<div class="relative"> <div class="relative">
<p>{{{this.formattedHtml}}}</p> <p>{{{this.formattedHtml}}}</p>

View file

@ -83,7 +83,7 @@ export default class KoenigCardEmailCtaComponent extends Component {
showButton: false, showButton: false,
showDividers: true, showDividers: true,
segment: 'status:free', segment: 'status:free',
buttonAlignment: 'left' alignment: 'left'
}; };
Object.entries(payloadDefaults).forEach(([key, value]) => { Object.entries(payloadDefaults).forEach(([key, value]) => {
@ -126,9 +126,9 @@ export default class KoenigCardEmailCtaComponent extends Component {
} }
@action @action
setButtonAlignment(alignment, event) { setAlignment(alignment, event) {
event.preventDefault(); event.preventDefault();
this._updatePayloadAttr('buttonAlignment', alignment); this._updatePayloadAttr('alignment', alignment);
} }
@action @action