layout fixes

This commit is contained in:
zadam 2021-06-15 21:53:22 +02:00
parent fb31acc8e0
commit 2220c4491b
4 changed files with 16 additions and 8 deletions

View File

@ -4,33 +4,33 @@ import froca from "./froca.js";
import attributeRenderer from "./attribute_renderer.js"; import attributeRenderer from "./attribute_renderer.js";
const TPL = ` const TPL = `
<div class="note-list-widget"> <div class="note-list">
<style> <style>
.note-list-widget { .note-list {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
height: 100%; height: 100%;
} }
.note-list-widget.grid-view .note-list-widget-container { .note-list.grid-view .note-list-container {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.note-list-widget.grid-view .note-book-card { .note-list.grid-view .note-book-card {
flex-basis: 300px; flex-basis: 300px;
border: 1px solid transparent; border: 1px solid transparent;
} }
.note-list-widget.grid-view .note-expander { .note-list.grid-view .note-expander {
display: none; display: none;
} }
.note-list-widget.grid-view .note-book-card { .note-list.grid-view .note-book-card {
max-height: 300px; max-height: 300px;
} }
.note-list-widget.grid-view .note-book-card:hover { .note-list.grid-view .note-book-card:hover {
cursor: pointer; cursor: pointer;
border: 1px solid var(--main-border-color); border: 1px solid var(--main-border-color);
background: var(--more-accented-background-color); background: var(--more-accented-background-color);
@ -198,7 +198,7 @@ class NoteListRenderer {
this.$noteList.show(); this.$noteList.show();
const $container = this.$noteList.find('.note-list-widget-container').empty(); const $container = this.$noteList.find('.note-list-container').empty();
const startIdx = (this.page - 1) * this.pageSize; const startIdx = (this.page - 1) * this.pageSize;
const endIdx = startIdx + this.pageSize; const endIdx = startIdx + this.pageSize;

View File

@ -75,6 +75,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
doRender() { doRender() {
this.$widget = $(TPL); this.$widget = $(TPL);
this.contentSized();
this.$widget.on("dragover", e => e.preventDefault()); this.$widget.on("dragover", e => e.preventDefault());

View File

@ -31,6 +31,7 @@ export default class NoteListWidget extends NoteContextAwareWidget {
doRender() { doRender() {
this.$widget = $(TPL); this.$widget = $(TPL);
this.contentSized();
this.$content = this.$widget.find('.note-list-widget-content'); this.$content = this.$widget.find('.note-list-widget-content');
const observer = new IntersectionObserver(entries => { const observer = new IntersectionObserver(entries => {

View File

@ -4,6 +4,12 @@ export default class TypeWidget extends NoteContextAwareWidget {
// for overriding // for overriding
static getType() {} static getType() {}
doRender() {
this.contentSized();
return super.doRender();
}
/** /**
* @param {NoteShort} note * @param {NoteShort} note
*/ */