Ghost/ghost/admin/lib/koenig-editor/addon/templates/components/koenig-toolbar.hbs
Kevin Ansfield 2231dd84c2 Migrated to <AngleBracketSyntax /> (#1460)
no issue

Ember is migrating to `<AngleBracketSyntax />` for component invocation, see https://github.com/emberjs/rfcs/blob/master/text/0311-angle-bracket-invocation.md

We were in a half-way situation where some templates used angle bracket syntax in some places, this PR updates templates to use the syntax everywhere.

This simplifies the rules for what template code is referring to...

`<Component>` = a component
`{{helper}}` = a helper (or locally assigned handlebars variable)
`{{this.foo}}` = data on the template backing context (a component/controller)
`{{@foo}}` = a named argument passed into the component that the component backing class has not modified (note: this commit does not introduce any named arguments)

- ran codemod https://github.com/ember-codemods/ember-angle-brackets-codemod on the following directories:
  - `app/templates`
  - `lib/koenig-editor/addon/templates`
- removed positional params from components as angle bracket syntax does not support them
  - `gh-feature-flag`
  - `gh-tour-item`
  - `gh-cm-editor`
  - `gh-fullscreen-modal`
  - `gh-task-button`
- updates some code that was missed in 3c851293c1 to use explicit this
2020-01-16 15:14:03 +00:00

70 lines
2.6 KiB
Handlebars

<KgActionBar @class="relative" @instantClose={{true}} @isVisible={{this.showToolbar}}>
<li class="ma0 lh-solid">
<button
type="button"
title="Bold"
class="dib dim-lite link h9 w9 nudge-top--1"
{{action "toggleMarkup" "strong"}}
>
{{svg-jar "koenig/kg-bold" class=(concat (if this.activeMarkupTagNames.isStrong "fill-blue-l2" "fill-white") " w4 h4")}}
</button>
</li>
<li class="ma0 lh-solid">
<button
type="button"
title="Italic"
class="dib dim-lite link h9 w9 nudge-top--1"
{{action "toggleMarkup" "em"}}
>
{{svg-jar "koenig/kg-italic" class=(concat (if (or this.activeMarkupTagNames.isEm this.activeMarkupTagNames.isI) "fill-blue-l2" "fill-white") " w4 h4")}}
</button>
</li>
{{#unless basicOnly}}
<li class="ma0 lh-solid">
<button
type="button"
title="Heading One"
class="dib dim-lite link h9 w9 nudge-top--1"
{{action "toggleHeaderSection" "h2"}}
>
{{svg-jar "koenig/kg-heading-1" class=(concat (if this.activeSectionTagNames.isH2 "fill-blue-l2" "fill-white") " w4 h4")}}
</button>
</li>
<li class="ma0 lh-solid">
<button
type="button"
title="Heading Two"
class="dib dim-lite link h9 w9 nudge-top--1"
{{action "toggleHeaderSection" "h3"}}
>
{{svg-jar "koenig/kg-heading-2" class=(concat (if this.activeSectionTagNames.isH3 "fill-blue-l2" "fill-white") " w4 h4")}}
</button>
</li>
{{/unless}}
<li class="ma0 lh-solid kg-action-bar-divider bg-darkgrey-l2 h5"></li>
{{#unless basicOnly}}
<li class="ma0 lh-solid">
<button
type="button"
title="Quote"
class="dib dim-lite link h9 w9 nudge-top--1"
{{action "toggleSection" "blockquote"}}
>
{{svg-jar "koenig/kg-quote" class=(concat (if this.activeSectionTagNames.isBlockquote "fill-blue-l2" "fill-white") " w4 h4")}}
</button>
</li>
{{/unless}}
<li class="ma0 lh-solid">
<button
type="button"
title="Link"
class="dib dim-lite link h9 w9 nudge-top--1"
{{action "editLink"}}
>
{{svg-jar "koenig/kg-link" class=(concat (if this.activeMarkupTagNames.isA "fill-blue-l2" "fill-white") " w4 h4")}}
</button>
</li>
</KgActionBar>