fix topic not adding

This commit is contained in:
ammarahm-ed
2020-05-13 01:46:02 +05:00
parent 5a37ed8b0e
commit d6fad82344
2 changed files with 18 additions and 10 deletions

View File

@@ -6,6 +6,7 @@
<style> <style>
.app-body { .app-body {
margin: 0px; margin: 0px;
overflow:hidden;
} }
.floating-toolbar { .floating-toolbar {
@@ -1055,7 +1056,7 @@
#titlebar input { #titlebar input {
font-family: "DM Serif Text", sans-serif; font-family: "DM Serif Text", sans-serif;
font-weight: 400 !important; font-weight: 400 !important;
width: 100vw; width: 100%;
background-color: transparent; background-color: transparent;
border: none; border: none;
height: 50; height: 50;
@@ -1619,16 +1620,15 @@
break; break;
case "nomenu": case "nomenu":
let isenabled = value; let isenabled = value;
let width = window.innerWidth;
let titleIn = document.getElementById('titlebar'); let titleIn = document.getElementById('titlebar');
if (isenabled) { if (isenabled) {
titleIn.style.width = width - 72;
titleIn.style['margin-left'] = 12; titleIn.style['padding-left'] = 12;
titleIn.style['margin-right'] = 60; titleIn.style['padding-right'] = 60;
} else { } else {
titleIn.style.width = width - 120;
titleIn.style['margin-left'] = 60; titleIn.style['padding-left'] = 60;
titleIn.style['margin-right'] = 60; titleIn.style['padding-right'] = 60;
} }
break; break;
case "title": case "title":

View File

@@ -113,12 +113,20 @@ export class AddNotebookDialog extends React.Component {
addNewNotebook = async () => { addNewNotebook = async () => {
setTimeout(async () => { setTimeout(async () => {
let {topics} = this.state; let {topics} = this.state;
let edit = this.props.toEdit;
let toEdit = db.notebooks.notebook(this.props.toEdit.id).data; console.log(this.title, "ELO");
if (!this.title || this.title.trim().length === 0) if (!this.title || this.title.trim().length === 0)
return ToastEvent.show('Title is required', 'error', 'local'); return ToastEvent.show('Title is required', 'error', 'local');
let id = toEdit && toEdit.id ? toEdit.id : null; let id = edit && edit.id ? edit.id : null;
let toEdit;
if (id) {
toEdit = db.notebooks.notebook(edit.id).data;
}
let prevTopics = [...topics]; let prevTopics = [...topics];
if ( if (