Improve desktop editing experience
This commit is contained in:
@@ -51,6 +51,10 @@
|
||||
|
||||
var state = CM.EditorState.create({
|
||||
doc: hidden.value,
|
||||
// Start with the caret at the end of the existing content — editing an
|
||||
// existing page almost always means appending, and the default (start
|
||||
// of doc) buries the caret behind the leading heading.
|
||||
selection: { anchor: hidden.value.length },
|
||||
extensions: [
|
||||
CM.history(),
|
||||
CM.drawSelection(),
|
||||
|
||||
@@ -410,6 +410,12 @@ a.heading-anchor:hover { color: var(--primary-hover); }
|
||||
background: var(--bg-panel-hover);
|
||||
overflow-x: auto;
|
||||
scrollbar-width: none;
|
||||
/* Keep the toolbar in reach on long pages: stick it to the top of the
|
||||
center column's scroll viewport (just under the header). Mobile overrides
|
||||
this to a keyboard-hugging bottom bar (see responsive block). */
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 30;
|
||||
}
|
||||
.editor-toolbar::-webkit-scrollbar { display: none; }
|
||||
.editor-toolbar > * { flex-shrink: 0; }
|
||||
@@ -432,6 +438,12 @@ body.edit-mode footer { max-width: none; }
|
||||
variables; this only sizes the container. */
|
||||
.editor-cm { min-height: 60vh; }
|
||||
.editor-cm .cm-editor { height: 100%; }
|
||||
/* Stretch the editable surface to fill the mount. Without this the
|
||||
contenteditable is only as tall as the text, so clicking in the empty region
|
||||
below a short document lands on the (non-editable) scroller and places no
|
||||
caret. Filling it means a click anywhere maps to the nearest position — the
|
||||
end of the document. */
|
||||
.editor-cm .cm-content { min-height: 60vh; }
|
||||
|
||||
/* === Search === */
|
||||
.search-form {
|
||||
|
||||
Reference in New Issue
Block a user