mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-12 22:26:08 -04:00
Add a toolbar to Codemirror editor
Signed-off-by: Edgar Zanella Alvarenga <e@vaz.io>
This commit is contained in:
parent
82c7f9d07c
commit
a8b664fdb5
5 changed files with 202 additions and 0 deletions
|
@ -30,6 +30,8 @@ import {
|
|||
import {
|
||||
debug,
|
||||
DROPBOX_APP_KEY,
|
||||
GOOGLE_API_KEY,
|
||||
GOOGLE_CLIENT_ID,
|
||||
noteid,
|
||||
noteurl,
|
||||
urlpath,
|
||||
|
@ -566,6 +568,9 @@ var previousFocusOnEditor = null
|
|||
|
||||
function checkEditorStyle () {
|
||||
var desireHeight = editorInstance.statusBar ? (ui.area.edit.height() - editorInstance.statusBar.outerHeight()) : ui.area.edit.height()
|
||||
if (editorInstance.toolBar) {
|
||||
desireHeight = desireHeight - editorInstance.toolBar.outerHeight()
|
||||
}
|
||||
// set editor height and min height based on scrollbar style and mode
|
||||
var scrollbarStyle = editor.getOption('scrollbarStyle')
|
||||
if (scrollbarStyle === 'overlay' || appState.currentMode === modeType.both) {
|
||||
|
@ -804,6 +809,10 @@ function changeMode (type) {
|
|||
editorInstance.addStatusBar()
|
||||
editorInstance.updateStatusBar()
|
||||
}
|
||||
// add and update tool bar
|
||||
if (!editorInstance.toolBar) {
|
||||
editorInstance.addToolBar()
|
||||
}
|
||||
// work around foldGutter might not init properly
|
||||
editor.setOption('foldGutter', false)
|
||||
editor.setOption('foldGutter', true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue