Remove top margin from first block

This commit is contained in:
Jonatan Heyman 2023-01-12 17:04:47 +01:00
parent 6d7abb1503
commit ee9e44028c
2 changed files with 7 additions and 3 deletions

View File

@ -69,8 +69,9 @@ export function getActiveNoteBlock(state) {
class NoteBlockStart extends WidgetType {
constructor() {
constructor(isFirst) {
super()
this.isFirst = isFirst
}
eq(other) {
//return other.checked == this.checked
@ -78,7 +79,7 @@ class NoteBlockStart extends WidgetType {
}
toDOM() {
let wrap = document.createElement("div")
wrap.className = "block-start"
wrap.className = "block-start" + (this.isFirst ? " first" : "")
//wrap.innerHTML = "<br>"
return wrap
}
@ -93,7 +94,7 @@ const noteBlockWidget = () => {
state.facet(blockState).forEach(block => {
let delimiter = block.delimiter
let deco = Decoration.replace({
widget: new NoteBlockStart(),
widget: new NoteBlockStart(delimiter.from === 0 ? true : false),
inclusive: true,
block: true,
side: 0,

View File

@ -44,3 +44,6 @@ body {
/*background: rgb(0, 0, 0);
height: 2px*/
}
.block-start.first {
height: 0;
}