diff --git a/dist/css/style.css b/dist/css/style.css index 1520e780..40774285 100644 --- a/dist/css/style.css +++ b/dist/css/style.css @@ -6813,16 +6813,17 @@ span.flatpickr-day.today, span.flatpickr-day.prevMonthDay.today, span.flatpickr- border-right: 0; } html { font-size: 12px; } -.main { - margin-left: -1px; +.desk-body { border-left: 1px solid #dee2e6; min-height: calc(100vh - 50px); } -.sidebar { +.desk-center { + border-left: 1px solid #dee2e6; } +.desk-menu { margin-right: -1px; } -.sidebar .list-group-item { +.desk-menu .list-group-item { padding: 0.5rem 1rem; border: none; } -.sidebar .list-group-flush { +.desk-menu .list-group-flush { margin-left: -1rem; margin-right: -1rem; } .hide { @@ -6849,7 +6850,7 @@ html { margin-left: -15px; margin-right: -15px; } .list-body .list-row { - padding: 0.5rem; + padding: 0.5rem 15px; border-bottom: 1px solid #e9ecef; } .list-body .list-row .checkbox { margin-right: 0.5rem; } diff --git a/dist/js/bundle.js b/dist/js/bundle.js index 3c81448e..0a7f6df7 100644 --- a/dist/js/bundle.js +++ b/dist/js/bundle.js @@ -17796,15 +17796,18 @@ var router = class Router extends observable { }; var page = class Page extends observable { - constructor(title) { + constructor({title, parent, hasRoute=true}) { super(); - this.title = title; + Object.assign(this, arguments[0]); + if (!this.parent) { + this.parent = frappejs.desk.body; + } this.make(); this.dropdowns = {}; } make() { - this.wrapper = frappejs.ui.add('div', 'page hide', frappejs.desk.body); + this.wrapper = frappejs.ui.add('div', 'page hide', this.parent); this.wrapper.innerHTML = `
`; this.head = this.wrapper.querySelector('.page-head'); @@ -17832,9 +17835,10 @@ var page = class Page extends observable { } async show(params) { - if (frappejs.router.current_page) { - frappejs.router.current_page.hide(); + if (this.parent.activePage) { + this.parent.activePage.hide(); } + this.wrapper.classList.remove('hide'); this.body.classList.remove('hide'); @@ -17842,8 +17846,11 @@ var page = class Page extends observable { this.page_error.classList.add('hide'); } - frappejs.router.current_page = this; - document.title = this.title; + this.parent.activePage = this; + + if (this.hasRoute) { + document.title = this.title; + } await this.trigger('show', params); } @@ -17941,7 +17948,7 @@ var list = class BaseList { makeToolbar() { this.makeSearch(); - this.btnNew = this.page.addButton(frappejs._('New'), 'btn-primary', async () => { + this.btnNew = this.page.addButton(frappejs._('New'), 'btn-outline-primary', async () => { await frappejs.router.setRoute('new', frappejs.slug(this.doctype)); }); this.btnDelete = this.page.addButton(frappejs._('Delete'), 'btn-outline-secondary hide', async () => { @@ -17959,7 +17966,7 @@ var list = class BaseList { this.toolbar = frappejs.ui.add('div', 'list-toolbar', this.parent); this.toolbar.innerHTML = `
-
+