From cbc7710d81dbcaed1efb342fa0e53edbda07b0b8 Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 5 Oct 2019 12:06:06 +0200 Subject: [PATCH] removed children overview (will be replaced by book) --- .../javascripts/services/protected_session.js | 3 +- .../javascripts/services/tab_context.js | 28 ------------- src/public/stylesheets/style.css | 41 +++---------------- src/services/attributes.js | 1 - src/views/tabs.ejs | 2 - 5 files changed, 6 insertions(+), 69 deletions(-) diff --git a/src/public/javascripts/services/protected_session.js b/src/public/javascripts/services/protected_session.js index 1ca0d3730..1dec6a894 100644 --- a/src/public/javascripts/services/protected_session.js +++ b/src/public/javascripts/services/protected_session.js @@ -46,8 +46,7 @@ async function setupProtectedSession(password) { await treeService.reload(); - // it's important that tree has been already reloaded at this point since detail also uses tree cache (for children overview) - // children overview is the reason why we need to reload all tabs + // it's important that tree has been already reloaded at this point since detail also uses tree cache (for book) await noteDetailService.reloadAllTabs(); if (protectedSessionDeferred !== null) { diff --git a/src/public/javascripts/services/tab_context.js b/src/public/javascripts/services/tab_context.js index 8f29c903c..6236a1d89 100644 --- a/src/public/javascripts/services/tab_context.js +++ b/src/public/javascripts/services/tab_context.js @@ -65,7 +65,6 @@ class TabContext { this.$notePathList = this.$tabContent.find(".note-path-list"); this.$notePathCount = this.$tabContent.find(".note-path-count"); this.$noteDetailComponents = this.$tabContent.find(".note-detail-component"); - this.$childrenOverview = this.$tabContent.find(".children-overview"); this.$scriptArea = this.$tabContent.find(".note-detail-script-area"); this.$savedIndicator = this.$tabContent.find(".saved-indicator"); this.noteChangeDisabled = false; @@ -180,8 +179,6 @@ class TabContext { if (utils.isDesktop()) { this.noteType.update(); - - this.showChildrenOverview(); } if (this.sidebar) { @@ -365,31 +362,6 @@ class TabContext { this.$savedIndicator.fadeOut(); } - async showChildrenOverview() { - const attributes = await this.attributes.getAttributes(); - const hideChildrenOverview = attributes.some(attr => attr.type === 'label' && attr.name === 'hideChildrenOverview') - || ['relation-map', 'image', 'file', 'book'].includes(this.note.type); - - if (hideChildrenOverview) { - this.$childrenOverview.hide(); - return; - } - - this.$childrenOverview.empty(); - - for (const childBranch of await this.note.getChildBranches()) { - const link = $('', { - href: 'javascript:', - text: await treeUtils.getNoteTitle(childBranch.noteId, childBranch.parentNoteId) - }).attr('data-action', 'note').attr('data-note-path', this.notePath + '/' + childBranch.noteId); - - const childEl = $('
').html(link); - this.$childrenOverview.append(childEl); - } - - this.$childrenOverview.show(); - } - async addPath(notePath, isCurrent) { const title = await treeUtils.getNotePathTitle(notePath); diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index 3f07af936..9f8e6de71 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -108,7 +108,7 @@ ul.fancytree-container { height: 100%; display: flex; flex-direction: column; - min-height: 200px; + min-height: 500px; overflow-wrap: break-word; /* otherwise CKEditor fails miserably on super long lines */ font-family: var(--detail-font-family); font-size: var(--detail-font-size); @@ -136,7 +136,7 @@ ul.fancytree-container { border: 0 !important; box-shadow: none !important; /* This is because with empty content height of editor is 0 and it's impossible to click into it */ - min-height: 200px; + min-height: 500px; } .note-detail-text p:first-child, .note-detail-text::before { @@ -353,11 +353,11 @@ div.ui-tooltip { } .note-detail-code-editor { - min-height: 200px; + min-height: 500px; } .note-detail-render { - min-height: 200px; + min-height: 500px; } .CodeMirror { @@ -367,7 +367,7 @@ div.ui-tooltip { } .CodeMirror-scroll { - min-height: 200px; + min-height: 500px; } .CodeMirror-gutters { @@ -390,37 +390,6 @@ div.ui-tooltip { font-size: larger; } -.children-overview { - flex-grow: 1000; - flex-shrink: 1000; - flex-basis: 0; - display: flex; - flex-wrap: wrap; - align-content: flex-start; - height: 110px; - overflow: auto; -} - -.child-overview-item { - font-weight: bold; - padding: 10px; - background: var(--accented-background-color); - width: 150px; - height: 85px; - line-height: 2em; - margin-right: 20px; - border-radius: 15px; - overflow: hidden; - text-align: center; - margin-top: 15px; - text-overflow: ellipsis; - overflow-wrap: break-word; -} - -.child-overview-item a { - color: var(--muted-text-color); -} - #sql-console-query { height: 150px; width: 100%; diff --git a/src/services/attributes.js b/src/services/attributes.js index 8f4102b27..3b2de4848 100644 --- a/src/services/attributes.js +++ b/src/services/attributes.js @@ -17,7 +17,6 @@ const BUILTIN_ATTRIBUTES = [ { type: 'label', name: 'disableInclusion' }, { type: 'label', name: 'appCss' }, { type: 'label', name: 'appTheme' }, - { type: 'label', name: 'hideChildrenOverview' }, { type: 'label', name: 'hidePromotedAttributes' }, { type: 'label', name: 'readOnly' }, { type: 'label', name: 'run', isDangerous: true }, diff --git a/src/views/tabs.ejs b/src/views/tabs.ejs index 2225c79fc..ed6168435 100644 --- a/src/views/tabs.ejs +++ b/src/views/tabs.ejs @@ -35,8 +35,6 @@ <% include details/protected_session_password.ejs %> <% include details/book.ejs %> - -