mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-08-07 17:19:44 +02:00
Added option to hide toolbar in editor
This commit is contained in:
@@ -107,6 +107,10 @@ export default class EditorField {
|
||||
textarea.data('codemirror', editor);
|
||||
textarea.data('toolbar', new Toolbar(textarea));
|
||||
|
||||
if (options.toolbar === false) {
|
||||
textarea.data('toolbar').ui.navigation.addClass('grav-editor-hide-toolbar');
|
||||
}
|
||||
|
||||
editor.on('change', () => editor.save());
|
||||
}
|
||||
|
||||
@@ -131,12 +135,6 @@ export class Toolbar {
|
||||
<div class="grav-editor-actions"></div>
|
||||
<div class="grav-editor-modes"></div>
|
||||
</div>
|
||||
`,
|
||||
states: `
|
||||
<div class="grav-editor-states">
|
||||
<div class="grav-editor-info"></div>
|
||||
<div class="grav-editor-modes"></div>
|
||||
</div>
|
||||
`
|
||||
};
|
||||
}
|
||||
@@ -146,8 +144,7 @@ export class Toolbar {
|
||||
this.codemirror = this.editor.data('codemirror');
|
||||
this.buttons = Buttons.navigation;
|
||||
this.ui = {
|
||||
navigation: $(Toolbar.templates().navigation),
|
||||
states: $(Toolbar.templates().states)
|
||||
navigation: $(Toolbar.templates().navigation)
|
||||
};
|
||||
|
||||
this.editor.parent('.grav-editor-content')
|
||||
|
||||
2
themes/grav/css-compiled/preset.css
vendored
2
themes/grav/css-compiled/preset.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
themes/grav/css-compiled/template.css
vendored
2
themes/grav/css-compiled/template.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
themes/grav/js/admin.min.js
vendored
2
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -788,6 +788,12 @@ form {
|
||||
}
|
||||
}
|
||||
|
||||
#admin-main .grav-editor-hide-toolbar + div {
|
||||
border: 1px solid $form-border;
|
||||
border-top-right-radius: $border-radius;
|
||||
border-top-left-radius: $border-radius;
|
||||
}
|
||||
|
||||
.grav-editor-content, .grav-editor-preview {
|
||||
border: 1px solid $form-border;
|
||||
border-top: 0;
|
||||
|
||||
@@ -77,6 +77,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.grav-editor-hide-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.grav-editor-toolbar .grav-editor-modes {
|
||||
li {
|
||||
&:first-child a {
|
||||
|
||||
Reference in New Issue
Block a user