Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Koenig - Added Code Block card to (+) and / menus
Browse files Browse the repository at this point in the history
refs TryGhost/Ghost#9623
- added code block card to (+) and / menus
- changed card row length to 3
- swapped html icon for code icon and added new html icon
  • Loading branch information
peterzimon authored and kevinansfield committed May 17, 2018
1 parent 150f68e commit cdee31b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/koenig-editor/addon/components/koenig-slash-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {htmlSafe} from '@ember/string';
import {run} from '@ember/runloop';
import {set} from '@ember/object';

const ROW_LENGTH = 4;
const ROW_LENGTH = 3;

const ITEM_MAP = [
{
Expand All @@ -30,6 +30,13 @@ const ITEM_MAP = [
type: 'card',
replaceArg: 'html'
},
{
label: 'Code Block',
icon: 'koenig/code-block',
matches: ['embed', 'code'],
type: 'card',
replaceArg: 'code'
},
{
label: 'Divider',
icon: 'koenig/divider',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<div class="{{kg-style "cardmenu-icon"}}">{{svg-jar "koenig/html" class="w8 h8 stroke-midgrey"}}</div>
<div class="{{kg-style "cardmenu-label"}}">HTML</div>
</div>
<div class="{{kg-style "cardmenu-card"}}" {{action "replaceWithCardSection" "code" on="click"}} data-kg="cardmenu-card">
<div class="{{kg-style "cardmenu-icon"}}">{{svg-jar "koenig/code-block" class="w8 h8 stroke-midgrey"}}</div>
<div class="{{kg-style "cardmenu-label"}}">Code Block</div>
</div>
<div class="{{kg-style "cardmenu-card"}}" {{action "replaceWithCardSection" "hr" on="click"}} data-kg="cardmenu-card">
<div class="{{kg-style "cardmenu-icon"}}">{{svg-jar "koenig/divider" class="w8 h8 stroke-midgrey"}}</div>
<div class="{{kg-style "cardmenu-label"}}">Divider</div>
Expand Down
6 changes: 6 additions & 0 deletions lib/koenig-editor/public/icons/koenig/code-block.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/koenig-editor/public/icons/koenig/html.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cdee31b

Please sign in to comment.