Skip to content

Commit

Permalink
Alt sticky toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 14, 2017
1 parent 90e8343 commit 8085917
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion blocks/library/freeform/old-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default class OldEditor extends Component {
key="toolbar"
id={ id + '-toolbar' }
ref={ ref => this.ref = ref }
className="editor-visual-editor__block-controls freeform-toolbar"
className="freeform-toolbar"
/>,
<div
key="editor"
Expand Down
14 changes: 11 additions & 3 deletions blocks/library/freeform/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

&.mce-edit-focus {
outline: none;
margin-top: $item-spacing;
}

a {
Expand Down Expand Up @@ -84,13 +85,21 @@
}
}

.editor-visual-editor__block-controls.freeform-toolbar {
.freeform-toolbar {
width: auto;
}

.freeform-toolbar .mce-tinymce-inline {
margin: 0;
background: transparent;
position: sticky;
top: $header-height - 1px;
z-index: z-index( '.editor-visual-editor__block-controls' );
margin-top: -$block-controls-height - $item-spacing;

@include break-medium() {
top: $header-height + $admin-bar-height + $item-spacing;
}
}

// Overwrite inline styles.
Expand Down Expand Up @@ -130,8 +139,7 @@ div.mce-toolbar-grp > div {

.freeform-toolbar .mce-toolbar:not(:first-child) {
display: none;
position: absolute;
top: -44px;
margin-top: 6px;
}

.freeform-toolbar.has-advanced-toolbar .mce-toolbar {
Expand Down

0 comments on commit 8085917

Please sign in to comment.