mirror of
https://github.com/heyman/heynote.git
synced 2025-06-20 09:37:50 +02: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 {
|
class NoteBlockStart extends WidgetType {
|
||||||
constructor() {
|
constructor(isFirst) {
|
||||||
super()
|
super()
|
||||||
|
this.isFirst = isFirst
|
||||||
}
|
}
|
||||||
eq(other) {
|
eq(other) {
|
||||||
//return other.checked == this.checked
|
//return other.checked == this.checked
|
||||||
@ -78,7 +79,7 @@ class NoteBlockStart extends WidgetType {
|
|||||||
}
|
}
|
||||||
toDOM() {
|
toDOM() {
|
||||||
let wrap = document.createElement("div")
|
let wrap = document.createElement("div")
|
||||||
wrap.className = "block-start"
|
wrap.className = "block-start" + (this.isFirst ? " first" : "")
|
||||||
//wrap.innerHTML = "<br>"
|
//wrap.innerHTML = "<br>"
|
||||||
return wrap
|
return wrap
|
||||||
}
|
}
|
||||||
@ -93,7 +94,7 @@ const noteBlockWidget = () => {
|
|||||||
state.facet(blockState).forEach(block => {
|
state.facet(blockState).forEach(block => {
|
||||||
let delimiter = block.delimiter
|
let delimiter = block.delimiter
|
||||||
let deco = Decoration.replace({
|
let deco = Decoration.replace({
|
||||||
widget: new NoteBlockStart(),
|
widget: new NoteBlockStart(delimiter.from === 0 ? true : false),
|
||||||
inclusive: true,
|
inclusive: true,
|
||||||
block: true,
|
block: true,
|
||||||
side: 0,
|
side: 0,
|
||||||
|
@ -44,3 +44,6 @@ body {
|
|||||||
/*background: rgb(0, 0, 0);
|
/*background: rgb(0, 0, 0);
|
||||||
height: 2px*/
|
height: 2px*/
|
||||||
}
|
}
|
||||||
|
.block-start.first {
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user