Ghost/ghost/admin/lib/gh-koenig/addon/components/koenig-toolbar-button.js
Ryan McCarvill 9a0b72071d 👯 ♥️ ♣️ ♦️ ♠️ New editor card menu (#580)
refs https://github.com/TryGhost/Ghost/issues/8106, https://github.com/TryGhost/Ghost/issues/7429, requires https://github.com/TryGhost/Ghost/pull/8137

-Adds new "card" menus
  - Navigation with keyboard in both axis.
  - Search with keyboard in both menus.
  - Adds a "+" Menu for cards
  - Adds a "/" Menu for cards
    - if the block has content and it becomes a markdown or HTML Embed card then the content is included into the card.
    - Image and HR cards appear below the current section
- Adds new toolbar with both inline and block styling.
- Adds a new 'divider' card.
2017-03-14 11:59:34 +00:00

34 lines
1.0 KiB
JavaScript

import Component from 'ember-component';
import layout from '../templates/components/koenig-toolbar-button';
export default Component.extend({
layout,
tagName: 'button',
classNameBindings: ['selected', 'primary', 'secondary',
'gh-toolbar-btn-bold', 'gh-toolbar-btn-italic', 'gh-toolbar-btn-strike', 'gh-toolbar-btn-link', 'gh-toolbar-btn-h1', 'gh-toolbar-btn-h2', 'gh-toolbar-btn-quote'],
classNames: ['gh-toolbar-btn'],
attributesBindings: ['title'],
title: 'bold',
// todo title="Bold", https://github.com/TryGhost/Ghost-Editor/commit/1133a9a7506f409b1b4fae6639c84c94c74dcebf
// actions: {
click() {
this.tool.onClick(this.editor);
},
// },
//
willRender() {
this.set(`gh-toolbar-btn-${this.tool.class}`, true);
if (this.tool.selected) {
this.set('selected', true);
} else {
this.set('selected', false);
}
if (this.tool.visibility) {
this.set(this.tool.visibility, true);
}
}
});