mirror of
https://github.com/heyman/heynote.git
synced 2024-11-22 07:54:11 +01:00
Remove top margin from first block
This commit is contained in:
parent
6d7abb1503
commit
ee9e44028c
@ -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,
|
||||
|
@ -44,3 +44,6 @@ body {
|
||||
/*background: rgb(0, 0, 0);
|
||||
height: 2px*/
|
||||
}
|
||||
.block-start.first {
|
||||
height: 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user