summaryrefslogtreecommitdiff
path: root/public/js/index.js
diff options
context:
space:
mode:
authorEdgar Zanella Alvarenga2018-06-19 16:03:32 +0200
committerEdgar Zanella Alvarenga2018-06-19 16:03:56 +0200
commita8b664fdb5b425625928d0ce6ae9cdbd78fb3833 (patch)
tree796556715b880d7d76f27bf3ad38e06fea3fd358 /public/js/index.js
parent82c7f9d07cfecfc110af8c8fc0e47edf070596b2 (diff)
Add a toolbar to Codemirror editor
Signed-off-by: Edgar Zanella Alvarenga <e@vaz.io>
Diffstat (limited to 'public/js/index.js')
-rw-r--r--public/js/index.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/public/js/index.js b/public/js/index.js
index c6a4f770..5e0aded6 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -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)