From c890bca595fda39b5bb296231a0b4837600a0d60 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 18 Jul 2016 15:04:40 +0530 Subject: [PATCH 1/5] [mobile ui] fixed navbar-breadcrumbs --- frappe/public/css/mobile.css | 5 +++++ frappe/public/less/mobile.less | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/frappe/public/css/mobile.css b/frappe/public/css/mobile.css index 6b5e5b8be6..de6b36e7e4 100644 --- a/frappe/public/css/mobile.css +++ b/frappe/public/css/mobile.css @@ -109,6 +109,11 @@ body { margin: 0px; display: inline-block; } + #navbar-breadcrumbs li { + max-width: 150px; + white-space: nowrap; + overflow: hidden; + } #navbar-breadcrumbs > li, #navbar-breadcrumbs > li > a { display: inline-block; diff --git a/frappe/public/less/mobile.less b/frappe/public/less/mobile.less index 6512957e6b..0d774cf5bb 100644 --- a/frappe/public/less/mobile.less +++ b/frappe/public/less/mobile.less @@ -72,6 +72,12 @@ #navbar-breadcrumbs { margin: 0px; display: inline-block; + + li { + max-width: 150px; + white-space: nowrap; + overflow: hidden; + } } #navbar-breadcrumbs > li, From 65f94ea85e14a7716fd7f64f9cc9de232adf8c5c Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 19 Jul 2016 14:55:51 +0530 Subject: [PATCH 2/5] comment out offcanvas related code [minor] toggle-sidebar button in form view delete offcanvas code --- frappe/public/js/docs.js | 15 --------------- frappe/public/js/frappe/desk.js | 8 -------- frappe/public/js/frappe/form/sidebar.js | 5 +---- frappe/public/js/frappe/list/list_sidebar.js | 9 +-------- frappe/public/js/frappe/ui/toolbar/toolbar.js | 11 ----------- frappe/public/js/legacy/form.js | 1 + frappe/templates/autodoc/base_template.html | 8 -------- frappe/templates/base.html | 8 -------- frappe/website/js/website.js | 16 ---------------- frappe/www/desk.html | 5 ----- 10 files changed, 3 insertions(+), 83 deletions(-) diff --git a/frappe/public/js/docs.js b/frappe/public/js/docs.js index 1e11253d1b..4fea7d676e 100644 --- a/frappe/public/js/docs.js +++ b/frappe/public/js/docs.js @@ -7,21 +7,6 @@ $(function() { }); } - $(".toggle-sidebar").on("click", function() { - $(".offcanvas").addClass("active-right"); - return false; - }); - - // collapse offcanvas sidebars! - $(".offcanvas .sidebar").on("click", "a", function() { - $(".offcanvas").removeClass("active-left active-right"); - }); - - $(".offcanvas-main-section-overlay").on("click", function() { - $(".offcanvas").removeClass("active-left active-right"); - return false; - }); - // search $('.sidebar-navbar-items .octicon-search, .navbar .octicon-search').parent().on("click", function() { var modal = frappe.get_modal("Search", diff --git a/frappe/public/js/frappe/desk.js b/frappe/public/js/frappe/desk.js index 27682ae6e0..d76e067163 100644 --- a/frappe/public/js/frappe/desk.js +++ b/frappe/public/js/frappe/desk.js @@ -217,14 +217,6 @@ frappe.Application = Class.extend({ frappe.frappe_toolbar = new frappe.ui.toolbar.Toolbar(); } - // collapse offcanvas sidebars! - $(".offcanvas .sidebar").on("click", "a", function() { - $(".offcanvas").removeClass("active-left active-right"); - }); - - $(".offcanvas-main-section-overlay").on("click", function() { - $(".offcanvas").removeClass("active-left active-right"); - }); }, logout: function() { var me = this; diff --git a/frappe/public/js/frappe/form/sidebar.js b/frappe/public/js/frappe/form/sidebar.js index d0ad1c8f7d..c78b8b700d 100644 --- a/frappe/public/js/frappe/form/sidebar.js +++ b/frappe/public/js/frappe/form/sidebar.js @@ -7,12 +7,10 @@ frappe.ui.form.Sidebar = Class.extend({ make: function() { var sidebar_content = frappe.render_template("form_sidebar", {doctype: this.frm.doctype, frm:this.frm}); - this.offcanvas_form_sidebar = $(".offcanvas .form-sidebar").html(sidebar_content); - this.page_sidebar = $('') + this.sidebar = $('') .html(sidebar_content) .appendTo(this.page.sidebar.empty()); - this.sidebar = this.page_sidebar.add(this.offcanvas_form_sidebar); this.comments = this.sidebar.find(".sidebar-comments"); this.user_actions = this.sidebar.find(".user-actions"); this.image_section = this.sidebar.find(".sidebar-image-section"); @@ -37,7 +35,6 @@ frappe.ui.form.Sidebar = Class.extend({ // scroll to comments this.comments.on("click", function() { - $(".offcanvas").removeClass("active-left active-right"); frappe.utils.scroll_to(me.frm.footer.wrapper.find(".form-comments"), true); }); diff --git a/frappe/public/js/frappe/list/list_sidebar.js b/frappe/public/js/frappe/list/list_sidebar.js index b8bf07a8e8..c81731799e 100644 --- a/frappe/public/js/frappe/list/list_sidebar.js +++ b/frappe/public/js/frappe/list/list_sidebar.js @@ -18,13 +18,10 @@ frappe.views.ListSidebar = Class.extend({ make: function() { var sidebar_content = frappe.render_template("list_sidebar", {doctype: this.doclistview.doctype}); - this.offcanvas_list_sidebar = $(".offcanvas .list-sidebar").html(sidebar_content); - this.page_sidebar = $('') + this.sidebar = $('') .html(sidebar_content) .appendTo(this.page.sidebar.empty()); - this.sidebar = this.page_sidebar.add(this.offcanvas_list_sidebar); - this.setup_reports(); this.setup_assigned_to_me(); this.setup_list_view_switching(); @@ -80,10 +77,6 @@ frappe.views.ListSidebar = Class.extend({ this.page.sidebar.find(".assigned-to-me a").on("click", function() { me.doclistview.assigned_to_me(); }); - - this.offcanvas_list_sidebar.find(".assigned-to-me a").on("click", function() { - me.doclistview.assigned_to_me(); - }); }, setup_list_view_switching: function() { var me = this; diff --git a/frappe/public/js/frappe/ui/toolbar/toolbar.js b/frappe/public/js/frappe/ui/toolbar/toolbar.js index 1c7c07a1da..3628ddcd30 100644 --- a/frappe/public/js/frappe/ui/toolbar/toolbar.js +++ b/frappe/public/js/frappe/ui/toolbar/toolbar.js @@ -8,9 +8,7 @@ frappe.ui.toolbar.Toolbar = Class.extend({ var header = $('header').append(frappe.render_template("navbar", { avatar: frappe.avatar(frappe.session.user) })); - var sidebar = $('.offcanvas .sidebar-left').append(frappe.render_template("offcanvas_left_sidebar", {})); - // header.find(".toggle-sidebar").on("click", frappe.ui.toolbar.toggle_left_sidebar); header.find(".toggle-sidebar").on("click", function () { var layout_side_section = $('.layout-side-section'); var overlay_sidebar = layout_side_section.find('.overlay-sidebar'); @@ -37,11 +35,6 @@ frappe.ui.toolbar.Toolbar = Class.extend({ } }); - header.find(".toggle-navbar-new-comments").on("click", function() { - $(".offcanvas").toggleClass("active-right").removeClass("active-left"); - return false; - }); - $(document).on("notification-update", function() { frappe.ui.notifications.update_notifications(); }); @@ -83,10 +76,6 @@ $.extend(frappe.ui.toolbar, { frappe.ui.toolbar.get_menu(menu) : menu; $('
  • ').prependTo(menu); - }, - toggle_left_sidebar: function() { - $(".offcanvas").toggleClass("active-left").removeClass("active-right"); - return false; } }); diff --git a/frappe/public/js/legacy/form.js b/frappe/public/js/legacy/form.js index 7585372e0d..6c388624b4 100644 --- a/frappe/public/js/legacy/form.js +++ b/frappe/public/js/legacy/form.js @@ -114,6 +114,7 @@ _f.Frm.prototype.setup = function() { frm: this, parent: $('
    ').appendTo(this.page.main.parent()) }) + $("body").attr("data-sidebar", 1); } this.setup_drag_drop(); diff --git a/frappe/templates/autodoc/base_template.html b/frappe/templates/autodoc/base_template.html index 9a86c1297a..bf1bdca4dc 100644 --- a/frappe/templates/autodoc/base_template.html +++ b/frappe/templates/autodoc/base_template.html @@ -96,14 +96,6 @@
    - - diff --git a/frappe/templates/base.html b/frappe/templates/base.html index 3b77b6eb7a..6e78686b26 100644 --- a/frappe/templates/base.html +++ b/frappe/templates/base.html @@ -80,14 +80,6 @@ {%- block footer -%}{% include "templates/includes/footer/footer.html" %}{%- endblock -%} - - diff --git a/frappe/website/js/website.js b/frappe/website/js/website.js index ab2a9c26ee..c669a27fc8 100644 --- a/frappe/website/js/website.js +++ b/frappe/website/js/website.js @@ -296,7 +296,6 @@ $.extend(frappe, { if(e.which===13 && val) { $(this).val("").blur(); frappe.do_search(val); - $(".offcanvas").removeClass("active-left active-right"); return false; } }); @@ -375,21 +374,6 @@ $(document).ready(function() { frappe.bind_navbar_search(); - $(".toggle-sidebar").on("click", function() { - $(".offcanvas").addClass("active-right"); - return false; - }); - - // collapse offcanvas sidebars! - $(".offcanvas .sidebar").on("click", "a", function() { - $(".offcanvas").removeClass("active-left active-right"); - }); - - $(".offcanvas-main-section-overlay").on("click", function() { - $(".offcanvas").removeClass("active-left active-right"); - return false; - }); - // switch to app link if(getCookie("system_user")==="yes" && logged_in) { $("#website-post-login .dropdown-menu").append('
  • Switch To Desk
  • '); diff --git a/frappe/www/desk.html b/frappe/www/desk.html index 0cddd42a40..410a639750 100644 --- a/frappe/www/desk.html +++ b/frappe/www/desk.html @@ -29,11 +29,6 @@
    - - - From 3bbf561fca07df55e489e0004e2335bf89d537f2 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 19 Jul 2016 16:12:42 +0530 Subject: [PATCH 3/5] close sidebar on link click --- frappe/desk/page/modules/modules.js | 1 - frappe/public/js/frappe/list/list_sidebar.js | 1 - frappe/public/js/frappe/ui/toolbar/toolbar.js | 7 +++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/frappe/desk/page/modules/modules.js b/frappe/desk/page/modules/modules.js index 0eb4e0f5f0..0558101952 100644 --- a/frappe/desk/page/modules/modules.js +++ b/frappe/desk/page/modules/modules.js @@ -34,7 +34,6 @@ frappe.pages['modules'].on_page_load = function(wrapper) { page.wrapper.find('.module-sidebar-item.active, .module-link.active').removeClass('active'); $(link).addClass('active').parent().addClass("active"); show_section($(link).attr('data-name')); - $('.module-sidebar-nav').trigger('close_sidebar'); } var show_section = function(module_name) { diff --git a/frappe/public/js/frappe/list/list_sidebar.js b/frappe/public/js/frappe/list/list_sidebar.js index c81731799e..b3e12fbbcf 100644 --- a/frappe/public/js/frappe/list/list_sidebar.js +++ b/frappe/public/js/frappe/list/list_sidebar.js @@ -162,7 +162,6 @@ frappe.views.ListSidebar = Class.extend({ var fieldname = $(this).attr('data-field'); var label = $(this).attr('data-label'); me.set_filter(fieldname, label); - return false; }) .appendTo(this.sidebar); }, diff --git a/frappe/public/js/frappe/ui/toolbar/toolbar.js b/frappe/public/js/frappe/ui/toolbar/toolbar.js index 3628ddcd30..7054898e53 100644 --- a/frappe/public/js/frappe/ui/toolbar/toolbar.js +++ b/frappe/public/js/frappe/ui/toolbar/toolbar.js @@ -22,14 +22,13 @@ frappe.ui.toolbar.Toolbar = Class.extend({ offcanvas_container.css("overflow-y", "hidden"); layout_side_section.find(".close-sidebar").on('click', close_sidebar); + layout_side_section.on("click", "a", close_sidebar); - $('.module-sidebar-nav').on('close_sidebar', close_sidebar); - - function close_sidebar() { - overlay_sidebar.removeClass('opened').find('.dropdown-toggle').removeClass('text-muted'); + function close_sidebar(e) { offcanvas_container.css("overflow-y", "visible"); layout_side_section.find(".close-sidebar").fadeOut(function() { + overlay_sidebar.removeClass('opened').find('.dropdown-toggle').removeClass('text-muted'); overlay_sidebar.find('.reports-dropdown').addClass('dropdown-menu'); }); } From 05f37bb36dd25c7fd49f6ceaf2bbd9e4d72f1d7e Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 19 Jul 2016 16:25:50 +0530 Subject: [PATCH 4/5] deleted offcanvas_left_sidebar.html --- .../ui/toolbar/offcanvas_left_sidebar.html | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 frappe/public/js/frappe/ui/toolbar/offcanvas_left_sidebar.html diff --git a/frappe/public/js/frappe/ui/toolbar/offcanvas_left_sidebar.html b/frappe/public/js/frappe/ui/toolbar/offcanvas_left_sidebar.html deleted file mode 100644 index b2a0e64681..0000000000 --- a/frappe/public/js/frappe/ui/toolbar/offcanvas_left_sidebar.html +++ /dev/null @@ -1,48 +0,0 @@ - - From 5207816d37a4f2ac7b30a20049749b7cabcded7d Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 20 Jul 2016 13:27:03 +0530 Subject: [PATCH 5/5] deleted offcanvas related files and code --- frappe/public/build.json | 1 - frappe/public/css/docs.css | 134 ----------------- frappe/public/css/mobile.css | 100 ------------- frappe/public/css/offcanvas-website.css | 132 ----------------- frappe/public/css/offcanvas.css | 57 -------- frappe/public/css/sidebar.css | 46 +----- frappe/public/css/website.css | 134 ----------------- frappe/public/js/frappe/ui/toolbar/toolbar.js | 6 +- frappe/public/less/docs.less | 10 -- frappe/public/less/mobile.less | 19 ++- frappe/public/less/offcanvas-website.less | 31 ---- frappe/public/less/offcanvas.less | 138 ------------------ frappe/public/less/sidebar.less | 21 ++- frappe/public/less/website.less | 2 - frappe/templates/autodoc/base_template.html | 110 +++++++------- frappe/templates/base.html | 60 ++++---- frappe/www/desk.html | 12 +- 17 files changed, 126 insertions(+), 887 deletions(-) delete mode 100644 frappe/public/less/offcanvas-website.less delete mode 100644 frappe/public/less/offcanvas.less diff --git a/frappe/public/build.json b/frappe/public/build.json index ccb37bd202..310f51abbb 100755 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -128,7 +128,6 @@ "public/js/frappe/ui/toolbar/awesome_bar.js", "public/js/frappe/ui/toolbar/about.js", "public/js/frappe/ui/toolbar/navbar.html", - "public/js/frappe/ui/toolbar/offcanvas_left_sidebar.html", "public/js/frappe/ui/toolbar/toolbar.js", "public/js/frappe/ui/toolbar/notifications.js", "public/js/frappe/views/communication.js", diff --git a/frappe/public/css/docs.css b/frappe/public/css/docs.css index 8c47d38318..ca262cdaf6 100644 --- a/frappe/public/css/docs.css +++ b/frappe/public/css/docs.css @@ -1,137 +1,3 @@ -html { - min-height: 100%; -} -body { - height: 100%; - /* The html and body elements cannot have any padding or margin. */ - margin: 0px; - padding: 0px !important; -} -html, -body { - overflow-x: hidden; - /* Prevent scroll on narrow devices */ -} -.offcanvas-main-section-overlay { - display: none; - cursor: pointer; - opacity: 0.5; -} -.sidebar-padding { - padding: 12px 14px; -} -.offcanvas .sidebar .sidebar-menu > li > .btn-group, -.offcanvas .sidebar .sidebar-menu > li > a, -.offcanvas .sidebar .dropdown-menu > li > a { - padding: 12px 14px; - display: block; - whitespace: nowrap; - transition: 0.2s; - text-decoration: none !important; -} -.offcanvas .sidebar .dropdown-menu { - padding: 0px; - font-size: inherit; -} -.offcanvas .sidebar .dropdown-menu > li > a { - padding-left: 28px; -} -.offcanvas .sidebar .divider { - height: 1px; - overflow: hidden; - background-color: #EBEFF2; - width: 100%; - margin: 0px; -} -.offcanvas .sidebar .badge { - right: 15px !important; - top: 11px !important; -} -.offcanvas .sidebar .sidebar-menu > li > a:hover, -.offcanvas .sidebar .dropdown-menu > li > a:hover, -.offcanvas .sidebar .sidebar-menu > li > a:focus, -.offcanvas .sidebar .dropdown-menu > li > a:focus, -.offcanvas .sidebar .sidebar-menu > li > a:active, -.offcanvas .sidebar .dropdown-menu > li > a:active { - background-color: #F0F4F7; -} -@media (max-width: 767px) { - .page-content { - min-height: 200px; - } - .offcanvas { - transition: 0.25s; - } - .offcanvas-main-section-overlay { - bottom: 0; - position: fixed; - } - .offcanvas-container, - .offcanvas, - .offcanvas-main-section { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - } - .offcanvas.active-left, - .offcanvas.active-right { - position: fixed; - } - .offcanvas.active-left .offcanvas-main-section-overlay, - .offcanvas.active-right .offcanvas-main-section-overlay { - z-index: 1031; - display: block; - bottom: 0; - } - .offcanvas.active-left { - -webkit-transform: translate3d(75%, 0, 0); - transform: translate3d(75%, 0, 0); - } - .offcanvas.active-right { - -webkit-transform: translate3d(-75%, 0, 0); - transform: translate3d(-75%, 0, 0); - } - .offcanvas .sidebar { - position: fixed; - top: 0; - bottom: 0; - width: 75%; - /* 9 columns */ - overflow-x: hidden; - overflow-y: auto; - font-size: 12px; - } - .offcanvas .sidebar-right { - left: 100%; - border-left: 1px solid #d1d8dd; - } - .offcanvas .sidebar-left { - right: 100%; - border-right: 1px solid #d1d8dd; - } - .offcanvas .sidebar-menu { - margin-bottom: 0; - } - .offcanvas .navbar-form { - margin: 0px; - } - .offcanvas .sidebar ul { - margin: 0px; - } - .offcanvas .sidebar-page-sidebar { - border-top: 1px solid #d1d8dd; - } - .offcanvas .sidebar-label { - text-transform: uppercase; - color: #8D99A6; - font-size: 85%; - margin: 0px; - font-weight: bold; - padding: 10px 15px 0px; - } -} .navbar .dropdown-toggle { padding-top: 8px; padding-bottom: 8px; diff --git a/frappe/public/css/mobile.css b/frappe/public/css/mobile.css index de6b36e7e4..556884f9ae 100644 --- a/frappe/public/css/mobile.css +++ b/frappe/public/css/mobile.css @@ -3,57 +3,12 @@ html { } body { height: 100%; - /* The html and body elements cannot have any padding or margin. */ margin: 0px; padding: 0px !important; } html, body { overflow-x: hidden; - /* Prevent scroll on narrow devices */ -} -.offcanvas-main-section-overlay { - display: none; - cursor: pointer; - opacity: 0.5; -} -.sidebar-padding { - padding: 12px 14px; -} -.offcanvas .sidebar .sidebar-menu > li > .btn-group, -.offcanvas .sidebar .sidebar-menu > li > a, -.offcanvas .sidebar .dropdown-menu > li > a { - padding: 12px 14px; - display: block; - whitespace: nowrap; - transition: 0.2s; - text-decoration: none !important; -} -.offcanvas .sidebar .dropdown-menu { - padding: 0px; - font-size: inherit; -} -.offcanvas .sidebar .dropdown-menu > li > a { - padding-left: 28px; -} -.offcanvas .sidebar .divider { - height: 1px; - overflow: hidden; - background-color: #EBEFF2; - width: 100%; - margin: 0px; -} -.offcanvas .sidebar .badge { - right: 15px !important; - top: 11px !important; -} -.offcanvas .sidebar .sidebar-menu > li > a:hover, -.offcanvas .sidebar .dropdown-menu > li > a:hover, -.offcanvas .sidebar .sidebar-menu > li > a:focus, -.offcanvas .sidebar .dropdown-menu > li > a:focus, -.offcanvas .sidebar .sidebar-menu > li > a:active, -.offcanvas .sidebar .dropdown-menu > li > a:active { - background-color: #F0F4F7; } @media (max-width: 991px) { .intro-area, @@ -130,61 +85,6 @@ body { .navbar-nav { margin: 0px; } - .offcanvas { - transition: 0.25s; - } - .offcanvas-main-section-overlay { - bottom: 0; - position: fixed; - } - .offcanvas-container, - .offcanvas, - .offcanvas-main-section { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - } - .offcanvas.active-left, - .offcanvas.active-right { - position: fixed; - } - .offcanvas.active-left .offcanvas-main-section-overlay, - .offcanvas.active-right .offcanvas-main-section-overlay { - z-index: 1031; - display: block; - bottom: 0; - } - .offcanvas.active-left { - -webkit-transform: translate3d(75%, 0, 0); - transform: translate3d(75%, 0, 0); - } - .offcanvas.active-right { - -webkit-transform: translate3d(-75%, 0, 0); - transform: translate3d(-75%, 0, 0); - } - .offcanvas .sidebar { - position: fixed; - top: 0; - bottom: 0; - width: 75%; - /* 9 columns */ - overflow-x: hidden; - overflow-y: auto; - font-size: 12px; - } - .offcanvas .sidebar-right { - left: 100%; - border-left: 1px solid #d1d8dd; - } - .offcanvas .sidebar-left { - right: 100%; - border-right: 1px solid #d1d8dd; - } - .offcanvas .sidebar-menu { - margin-bottom: 0; - } .sidebar .form-group { margin-bottom: 0px; } diff --git a/frappe/public/css/offcanvas-website.css b/frappe/public/css/offcanvas-website.css index 4a3502232b..dd10c4ae29 100644 --- a/frappe/public/css/offcanvas-website.css +++ b/frappe/public/css/offcanvas-website.css @@ -1,134 +1,2 @@ -html { - min-height: 100%; -} -body { - height: 100%; - /* The html and body elements cannot have any padding or margin. */ - margin: 0px; - padding: 0px !important; -} -html, -body { - overflow-x: hidden; - /* Prevent scroll on narrow devices */ -} -.offcanvas-main-section-overlay { - display: none; - cursor: pointer; - opacity: 0.5; -} -.sidebar-padding { - padding: 12px 14px; -} -.offcanvas .sidebar .sidebar-menu > li > .btn-group, -.offcanvas .sidebar .sidebar-menu > li > a, -.offcanvas .sidebar .dropdown-menu > li > a { - padding: 12px 14px; - display: block; - whitespace: nowrap; - transition: 0.2s; - text-decoration: none !important; -} -.offcanvas .sidebar .dropdown-menu { - padding: 0px; - font-size: inherit; -} -.offcanvas .sidebar .dropdown-menu > li > a { - padding-left: 28px; -} -.offcanvas .sidebar .divider { - height: 1px; - overflow: hidden; - background-color: #EBEFF2; - width: 100%; - margin: 0px; -} -.offcanvas .sidebar .badge { - right: 15px !important; - top: 11px !important; -} -.offcanvas .sidebar .sidebar-menu > li > a:hover, -.offcanvas .sidebar .dropdown-menu > li > a:hover, -.offcanvas .sidebar .sidebar-menu > li > a:focus, -.offcanvas .sidebar .dropdown-menu > li > a:focus, -.offcanvas .sidebar .sidebar-menu > li > a:active, -.offcanvas .sidebar .dropdown-menu > li > a:active { - background-color: #F0F4F7; -} @media (max-width: 767px) { - .page-content { - min-height: 200px; - } - .offcanvas { - transition: 0.25s; - } - .offcanvas-main-section-overlay { - bottom: 0; - position: fixed; - } - .offcanvas-container, - .offcanvas, - .offcanvas-main-section { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - } - .offcanvas.active-left, - .offcanvas.active-right { - position: fixed; - } - .offcanvas.active-left .offcanvas-main-section-overlay, - .offcanvas.active-right .offcanvas-main-section-overlay { - z-index: 1031; - display: block; - bottom: 0; - } - .offcanvas.active-left { - -webkit-transform: translate3d(75%, 0, 0); - transform: translate3d(75%, 0, 0); - } - .offcanvas.active-right { - -webkit-transform: translate3d(-75%, 0, 0); - transform: translate3d(-75%, 0, 0); - } - .offcanvas .sidebar { - position: fixed; - top: 0; - bottom: 0; - width: 75%; - /* 9 columns */ - overflow-x: hidden; - overflow-y: auto; - font-size: 12px; - } - .offcanvas .sidebar-right { - left: 100%; - border-left: 1px solid #d1d8dd; - } - .offcanvas .sidebar-left { - right: 100%; - border-right: 1px solid #d1d8dd; - } - .offcanvas .sidebar-menu { - margin-bottom: 0; - } - .offcanvas .navbar-form { - margin: 0px; - } - .offcanvas .sidebar ul { - margin: 0px; - } - .offcanvas .sidebar-page-sidebar { - border-top: 1px solid #d1d8dd; - } - .offcanvas .sidebar-label { - text-transform: uppercase; - color: #8D99A6; - font-size: 85%; - margin: 0px; - font-weight: bold; - padding: 10px 15px 0px; - } } diff --git a/frappe/public/css/offcanvas.css b/frappe/public/css/offcanvas.css index 850f6feb85..e69de29bb2 100644 --- a/frappe/public/css/offcanvas.css +++ b/frappe/public/css/offcanvas.css @@ -1,57 +0,0 @@ -html { - min-height: 100%; -} -body { - height: 100%; - /* The html and body elements cannot have any padding or margin. */ - margin: 0px; - padding: 0px !important; -} -html, -body { - overflow-x: hidden; - /* Prevent scroll on narrow devices */ -} -.offcanvas-main-section-overlay { - display: none; - cursor: pointer; - opacity: 0.5; -} -.sidebar-padding { - padding: 12px 14px; -} -.offcanvas .sidebar .sidebar-menu > li > .btn-group, -.offcanvas .sidebar .sidebar-menu > li > a, -.offcanvas .sidebar .dropdown-menu > li > a { - padding: 12px 14px; - display: block; - whitespace: nowrap; - transition: 0.2s; - text-decoration: none !important; -} -.offcanvas .sidebar .dropdown-menu { - padding: 0px; - font-size: inherit; -} -.offcanvas .sidebar .dropdown-menu > li > a { - padding-left: 28px; -} -.offcanvas .sidebar .divider { - height: 1px; - overflow: hidden; - background-color: #EBEFF2; - width: 100%; - margin: 0px; -} -.offcanvas .sidebar .badge { - right: 15px !important; - top: 11px !important; -} -.offcanvas .sidebar .sidebar-menu > li > a:hover, -.offcanvas .sidebar .dropdown-menu > li > a:hover, -.offcanvas .sidebar .sidebar-menu > li > a:focus, -.offcanvas .sidebar .dropdown-menu > li > a:focus, -.offcanvas .sidebar .sidebar-menu > li > a:active, -.offcanvas .sidebar .dropdown-menu > li > a:active { - background-color: #F0F4F7; -} diff --git a/frappe/public/css/sidebar.css b/frappe/public/css/sidebar.css index 5c58f3fb02..f742029c2b 100644 --- a/frappe/public/css/sidebar.css +++ b/frappe/public/css/sidebar.css @@ -3,61 +3,19 @@ html { } body { height: 100%; - /* The html and body elements cannot have any padding or margin. */ margin: 0px; padding: 0px !important; } html, body { overflow-x: hidden; - /* Prevent scroll on narrow devices */ } -.offcanvas-main-section-overlay { - display: none; - cursor: pointer; - opacity: 0.5; +.hide-form-sidebar .form-sidebar { + display: none !important; } .sidebar-padding { padding: 12px 14px; } -.offcanvas .sidebar .sidebar-menu > li > .btn-group, -.offcanvas .sidebar .sidebar-menu > li > a, -.offcanvas .sidebar .dropdown-menu > li > a { - padding: 12px 14px; - display: block; - whitespace: nowrap; - transition: 0.2s; - text-decoration: none !important; -} -.offcanvas .sidebar .dropdown-menu { - padding: 0px; - font-size: inherit; -} -.offcanvas .sidebar .dropdown-menu > li > a { - padding-left: 28px; -} -.offcanvas .sidebar .divider { - height: 1px; - overflow: hidden; - background-color: #EBEFF2; - width: 100%; - margin: 0px; -} -.offcanvas .sidebar .badge { - right: 15px !important; - top: 11px !important; -} -.offcanvas .sidebar .sidebar-menu > li > a:hover, -.offcanvas .sidebar .dropdown-menu > li > a:hover, -.offcanvas .sidebar .sidebar-menu > li > a:focus, -.offcanvas .sidebar .dropdown-menu > li > a:focus, -.offcanvas .sidebar .sidebar-menu > li > a:active, -.offcanvas .sidebar .dropdown-menu > li > a:active { - background-color: #F0F4F7; -} -.hide-form-sidebar .form-sidebar { - display: none !important; -} body[data-route=""] .main-menu .desk-sidebar, body[data-route="desk"] .main-menu .desk-sidebar { display: block !important; diff --git a/frappe/public/css/website.css b/frappe/public/css/website.css index 9d19b7ce02..c0cad574aa 100644 --- a/frappe/public/css/website.css +++ b/frappe/public/css/website.css @@ -764,140 +764,6 @@ a.active { .docs-attr-desc { padding-left: 30px; } -html { - min-height: 100%; -} -body { - height: 100%; - /* The html and body elements cannot have any padding or margin. */ - margin: 0px; - padding: 0px !important; -} -html, -body { - overflow-x: hidden; - /* Prevent scroll on narrow devices */ -} -.offcanvas-main-section-overlay { - display: none; - cursor: pointer; - opacity: 0.5; -} -.sidebar-padding { - padding: 12px 14px; -} -.offcanvas .sidebar .sidebar-menu > li > .btn-group, -.offcanvas .sidebar .sidebar-menu > li > a, -.offcanvas .sidebar .dropdown-menu > li > a { - padding: 12px 14px; - display: block; - whitespace: nowrap; - transition: 0.2s; - text-decoration: none !important; -} -.offcanvas .sidebar .dropdown-menu { - padding: 0px; - font-size: inherit; -} -.offcanvas .sidebar .dropdown-menu > li > a { - padding-left: 28px; -} -.offcanvas .sidebar .divider { - height: 1px; - overflow: hidden; - background-color: #EBEFF2; - width: 100%; - margin: 0px; -} -.offcanvas .sidebar .badge { - right: 15px !important; - top: 11px !important; -} -.offcanvas .sidebar .sidebar-menu > li > a:hover, -.offcanvas .sidebar .dropdown-menu > li > a:hover, -.offcanvas .sidebar .sidebar-menu > li > a:focus, -.offcanvas .sidebar .dropdown-menu > li > a:focus, -.offcanvas .sidebar .sidebar-menu > li > a:active, -.offcanvas .sidebar .dropdown-menu > li > a:active { - background-color: #F0F4F7; -} -@media (max-width: 767px) { - .page-content { - min-height: 200px; - } - .offcanvas { - transition: 0.25s; - } - .offcanvas-main-section-overlay { - bottom: 0; - position: fixed; - } - .offcanvas-container, - .offcanvas, - .offcanvas-main-section { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - } - .offcanvas.active-left, - .offcanvas.active-right { - position: fixed; - } - .offcanvas.active-left .offcanvas-main-section-overlay, - .offcanvas.active-right .offcanvas-main-section-overlay { - z-index: 1031; - display: block; - bottom: 0; - } - .offcanvas.active-left { - -webkit-transform: translate3d(75%, 0, 0); - transform: translate3d(75%, 0, 0); - } - .offcanvas.active-right { - -webkit-transform: translate3d(-75%, 0, 0); - transform: translate3d(-75%, 0, 0); - } - .offcanvas .sidebar { - position: fixed; - top: 0; - bottom: 0; - width: 75%; - /* 9 columns */ - overflow-x: hidden; - overflow-y: auto; - font-size: 12px; - } - .offcanvas .sidebar-right { - left: 100%; - border-left: 1px solid #d1d8dd; - } - .offcanvas .sidebar-left { - right: 100%; - border-right: 1px solid #d1d8dd; - } - .offcanvas .sidebar-menu { - margin-bottom: 0; - } - .offcanvas .navbar-form { - margin: 0px; - } - .offcanvas .sidebar ul { - margin: 0px; - } - .offcanvas .sidebar-page-sidebar { - border-top: 1px solid #d1d8dd; - } - .offcanvas .sidebar-label { - text-transform: uppercase; - color: #8D99A6; - font-size: 85%; - margin: 0px; - font-weight: bold; - padding: 10px 15px 0px; - } -} @media (min-width: 768px) { .login-wrapper { border-right: 1px solid #f2f2f2; diff --git a/frappe/public/js/frappe/ui/toolbar/toolbar.js b/frappe/public/js/frappe/ui/toolbar/toolbar.js index 7054898e53..3789d7995a 100644 --- a/frappe/public/js/frappe/ui/toolbar/toolbar.js +++ b/frappe/public/js/frappe/ui/toolbar/toolbar.js @@ -18,14 +18,14 @@ frappe.ui.toolbar.Toolbar = Class.extend({ $('
    ').hide().appendTo(layout_side_section).fadeIn(); - var offcanvas_container = $('body').find('.offcanvas-container'); - offcanvas_container.css("overflow-y", "hidden"); + var scroll_container = $('html'); + scroll_container.css("overflow-y", "hidden"); layout_side_section.find(".close-sidebar").on('click', close_sidebar); layout_side_section.on("click", "a", close_sidebar); function close_sidebar(e) { - offcanvas_container.css("overflow-y", "visible"); + scroll_container.css("overflow-y", ""); layout_side_section.find(".close-sidebar").fadeOut(function() { overlay_sidebar.removeClass('opened').find('.dropdown-toggle').removeClass('text-muted'); diff --git a/frappe/public/less/docs.less b/frappe/public/less/docs.less index be8497a083..14d4baa3d3 100644 --- a/frappe/public/less/docs.less +++ b/frappe/public/less/docs.less @@ -1,5 +1,4 @@ @import "variables.less"; -@import "offcanvas-website.less"; @import "navbar.less"; body { @@ -391,15 +390,6 @@ a.edit, a.edit:hover, a.edit:focus, a.edit:visited, .edit-container .icon { font-size:16px; } -// @media (max-width: 767px) { -// .offcanvas-container, -// .offcanvas, -// .offcanvas-main-section { -// position: relative; -// width:50%; -// } -// } - .hero-and-content [data-html-block="hero"] { overflow-y: hidden; } diff --git a/frappe/public/less/mobile.less b/frappe/public/less/mobile.less index 0d774cf5bb..3a93b0c954 100644 --- a/frappe/public/less/mobile.less +++ b/frappe/public/less/mobile.less @@ -1,6 +1,21 @@ @import "variables.less"; @import "mixins.less"; -@import "offcanvas.less"; + +html { + min-height: 100%; +} + +body { + height: 100%; + // The html and body elements cannot have any padding or margin. + margin: 0px; + padding: 0px !important; +} + +html, +body { + overflow-x: hidden; //Prevent scroll on narrow devices +} @media(max-width: 991px) { .intro-area, @@ -99,8 +114,6 @@ margin: 0px; } - .offcanvas-mobile-mixin(); - .sidebar .form-group { margin-bottom: 0px; } diff --git a/frappe/public/less/offcanvas-website.less b/frappe/public/less/offcanvas-website.less deleted file mode 100644 index b30b56e2c4..0000000000 --- a/frappe/public/less/offcanvas-website.less +++ /dev/null @@ -1,31 +0,0 @@ -@import "offcanvas.less"; - -@media (max-width: 767px) { - .page-content { - min-height: 200px; - } - - .offcanvas-mobile-mixin(); - - .offcanvas { - .navbar-form { - margin: 0px; - } - .sidebar ul { - margin: 0px; - } - - .sidebar-page-sidebar { - border-top: 1px solid @border-color; - } - - .sidebar-label { - text-transform: uppercase; - color: @text-muted; - font-size: 85%; - margin: 0px; - font-weight: bold; - padding: 10px 15px 0px; - } - } -} diff --git a/frappe/public/less/offcanvas.less b/frappe/public/less/offcanvas.less deleted file mode 100644 index 7883c6f0b7..0000000000 --- a/frappe/public/less/offcanvas.less +++ /dev/null @@ -1,138 +0,0 @@ -@import "variables.less"; - -html { - min-height: 100%; -} - -body { - height: 100%; - /* The html and body elements cannot have any padding or margin. */ - margin: 0px; - padding: 0px !important; -} - -html, -body { - overflow-x: hidden; /* Prevent scroll on narrow devices */ -} - -.offcanvas-main-section-overlay { - display: none; - cursor: pointer; - opacity: 0.5; -} - -.sidebar-padding { - padding: 12px 14px; -} - -.offcanvas .sidebar { - .sidebar-menu > li > .btn-group, - .sidebar-menu > li > a, - .dropdown-menu > li > a { - .sidebar-padding; - display: block; - whitespace: nowrap; - transition: 0.2s; - text-decoration: none !important; - } - - .dropdown-menu { - padding: 0px; - font-size: inherit; - } - - .dropdown-menu > li > a { - padding-left: 28px; - } - - .divider { - height: 1px; - overflow: hidden; - background-color: @navbar-default-border; - width: 100%; - margin: 0px; - } - - .badge { - right: 15px !important; - top: 11px !important; - } -} - -.offcanvas .sidebar .sidebar-menu > li > a&, -.offcanvas .sidebar .dropdown-menu > li > a& { - &:hover, - &:focus, - &:active { - background-color: @btn-bg; - } -} - -.offcanvas-mobile-mixin() { - .offcanvas { - transition: 0.25s; - } - - .offcanvas-main-section-overlay { - bottom: 0; - position: fixed; - } - - .offcanvas-container, - .offcanvas, - .offcanvas-main-section { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - } - - .offcanvas.active-left, - .offcanvas.active-right { - position: fixed; - } - - .offcanvas.active-left .offcanvas-main-section-overlay, - .offcanvas.active-right .offcanvas-main-section-overlay { - z-index: 1031; - display: block; - bottom: 0; - } - - .offcanvas.active-left { - -webkit-transform: translate3d(75%, 0, 0); - transform: translate3d(75%, 0, 0); - } - - .offcanvas.active-right { - -webkit-transform: translate3d(-75%, 0, 0); - transform: translate3d(-75%, 0, 0); - } - - .offcanvas .sidebar { - position: fixed; - // position: absolute; - top: 0; - bottom: 0; - width: 75%; /* 9 columns */ - overflow-x: hidden; - overflow-y: auto; - font-size: 12px; - } - - .offcanvas .sidebar-right { - left: 100%; - border-left: 1px solid @border-color; - } - - .offcanvas .sidebar-left { - right: 100%; - border-right: 1px solid @border-color; - } - - .offcanvas .sidebar-menu { - margin-bottom: 0; - } -} diff --git a/frappe/public/less/sidebar.less b/frappe/public/less/sidebar.less index 8f61b576a4..2baae84691 100644 --- a/frappe/public/less/sidebar.less +++ b/frappe/public/less/sidebar.less @@ -1,6 +1,21 @@ @import "variables.less"; @import "mixins.less"; -@import "offcanvas.less"; + +html { + min-height: 100%; +} + +body { + height: 100%; + // The html and body elements cannot have any padding or margin. + margin: 0px; + padding: 0px !important; +} + +html, +body { + overflow-x: hidden; //Prevent scroll on narrow devices +} .hide-form-sidebar { .form-sidebar { @@ -8,6 +23,10 @@ } } +.sidebar-padding { + padding: 12px 14px; +} + body[data-route=""] .main-menu, body[data-route="desk"] .main-menu { .desk-sidebar { diff --git a/frappe/public/less/website.less b/frappe/public/less/website.less index 1d6a5edd45..b481121221 100644 --- a/frappe/public/less/website.less +++ b/frappe/public/less/website.less @@ -496,8 +496,6 @@ a.active { padding-left: 30px; } -@import "offcanvas-website.less"; - @media (min-width: 768px) { .login-wrapper { border-right: 1px solid #f2f2f2; diff --git a/frappe/templates/autodoc/base_template.html b/frappe/templates/autodoc/base_template.html index bf1bdca4dc..c04161dea6 100644 --- a/frappe/templates/autodoc/base_template.html +++ b/frappe/templates/autodoc/base_template.html @@ -36,66 +36,62 @@ {%- endblock -%} -
    -
    -
    -
    - {%- block banner -%} - {% include "templates/includes/banner_extension.html" ignore missing %} - {% if banner_html -%} -
    {{ banner_html or "" }}
    - {%- endif %} - {%- endblock -%} +
    +
    + {%- block banner -%} + {% include "templates/includes/banner_extension.html" ignore missing %} + {% if banner_html -%} +
    {{ banner_html or "" }}
    + {%- endif %} + {%- endblock -%} - {%- block navbar -%} - {% include "templates/includes/navbar/navbar.html" %} - {%- endblock -%} -
    -
    - {%- block hero -%}{%- endblock -%} -
    -
    - {% block content %}{% endblock %} - -
    -
    -
    -
    - {%- if footer is defined -%}{{ footer }}{%- endif -%} + {%- block navbar -%} + {% include "templates/includes/navbar/navbar.html" %} + {%- endblock -%} +
    +
    + {%- block hero -%}{%- endblock -%} +
    +
    + {% block content %}{% endblock %} + +
    +
    + -
    -
    +
    +
    diff --git a/frappe/templates/base.html b/frappe/templates/base.html index 6e78686b26..383d230f22 100644 --- a/frappe/templates/base.html +++ b/frappe/templates/base.html @@ -46,40 +46,36 @@ -
    -
    -
    -
    - {%- block banner -%} - {% include "templates/includes/banner_extension.html" ignore missing %} - {% if banner_html -%} -
    {{ banner_html or "" }}
    - {%- endif %} - {%- endblock -%} +
    +
    + {%- block banner -%} + {% include "templates/includes/banner_extension.html" ignore missing %} + {% if banner_html -%} +
    {{ banner_html or "" }}
    + {%- endif %} + {%- endblock -%} - {%- block navbar -%} - {% include "templates/includes/navbar/navbar.html" %} - {%- endblock -%} -
    -
    - {%- block hero -%}{%- endblock -%} -
    -
    - {% block content %}{% endblock %} -
    -
    - {%- if footer is defined -%} -
    -
    - {{ footer }} -
    -
    - {%- endif -%} + {%- block navbar -%} + {% include "templates/includes/navbar/navbar.html" %} + {%- endblock -%} +
    +
    + {%- block hero -%}{%- endblock -%} +
    +
    + {% block content %}{% endblock %} +
    +
    + {%- if footer is defined -%} +
    +
    + {{ footer }}
    -
    - {%- block footer -%}{% include "templates/includes/footer/footer.html" %}{%- endblock -%} -
    -
    + + {%- endif -%} +
    +
    + {%- block footer -%}{% include "templates/includes/footer/footer.html" %}{%- endblock -%}
    diff --git a/frappe/www/desk.html b/frappe/www/desk.html index 410a639750..3bd4e8375f 100644 --- a/frappe/www/desk.html +++ b/frappe/www/desk.html @@ -22,14 +22,10 @@
    -
    -
    -
    -
    -
    -
    -
    -
    +
    +
    +
    +