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

Commit

Permalink
Card menu trigger styling
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnONolan committed Mar 15, 2017
1 parent 1c0a252 commit 5b494a0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
30 changes: 17 additions & 13 deletions app/styles/addons/ghost-editor/cardmenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,24 @@
z-index: 9999999; /* have to compete with codemirror */
}

#gh-cardmenu-button {
position:absolute;
width: 40px;
height: 40px;
background-color:pink;
font-size:40px;
line-height: 40px;
color: powderblue;
font-family: "Comic Sans MS", cursive, sans-serif;
.gh-cardmenu-button {
position: absolute;
width: 30px;
height: 30px;
padding: 6px;
border: var(--midgrey) 1px solid;
background: #fff;
border-radius: 100%;
font-size: 16px;
line-height: 16px;
text-align: center;
color: var(--midgrey);
}

.gh-cardmenu-button svg path {
stroke: var(--midgrey);
stroke-width: 2px;
}
#gh-cardmenu-button:hover {
background-color:red;
color: yellow;
}

.gh-cardmenu-search {
position: relative;
Expand Down
8 changes: 4 additions & 4 deletions lib/gh-koenig/addon/components/koenig-plus-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ export default Component.extend({
this.set('isButton', true);
run.schedule('afterRender', this,
() => {
let button = this.$('#gh-cardmenu-button');
button.css('top', offset.top + $editor.scrollTop() - editorOffset.top - 5);
let button = this.$('.gh-cardmenu-button');
button.css('top', offset.top + $editor.scrollTop() - editorOffset.top - 2);
if (currentNode.tagName.toLowerCase() === 'li') {
button.css('left', this.$(currentNode.parentNode).position().left + $editor.scrollLeft() - 90);
} else {
button.css('left', offset.left + $editor.scrollLeft() - 90);
button.css('left', offset.left + $editor.scrollLeft() - 50);
}
});
});
},
actions: {
openMenu: function () { // eslint-disable-line
let button = this.$('#gh-cardmenu-button');
let button = this.$('.gh-cardmenu-button');
let editor = this.get('editor');
this.set('isOpen', true);

Expand Down
4 changes: 2 additions & 2 deletions lib/gh-koenig/addon/templates/components/koenig-plus-menu.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#if showButton}}
<button id="gh-cardmenu-button" {{action "openMenu"}}>+</button>
<button class="gh-cardmenu-button" {{action "openMenu"}}>{{inline-svg "plus"}}</button>
{{/if}}
{{#if isOpen}}
<div class="gh-cardmenu">
Expand All @@ -14,4 +14,4 @@
{{koenig-menu-item tool=tool editor=editor range=range selected=tool.selected clicked=(action "closeMenu")}}
{{/each}}
</div>
{{/if}}
{{/if}}
1 change: 1 addition & 0 deletions public/assets/icons/plus.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 5b494a0

Please sign in to comment.