[minor] toggle-sidebar button in form view delete offcanvas codeversion-14
@@ -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 | // search | ||||
$('.sidebar-navbar-items .octicon-search, .navbar .octicon-search').parent().on("click", function() { | $('.sidebar-navbar-items .octicon-search, .navbar .octicon-search').parent().on("click", function() { | ||||
var modal = frappe.get_modal("Search", | var modal = frappe.get_modal("Search", | ||||
@@ -217,14 +217,6 @@ frappe.Application = Class.extend({ | |||||
frappe.frappe_toolbar = new frappe.ui.toolbar.Toolbar(); | 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() { | logout: function() { | ||||
var me = this; | var me = this; | ||||
@@ -7,12 +7,10 @@ frappe.ui.form.Sidebar = Class.extend({ | |||||
make: function() { | make: function() { | ||||
var sidebar_content = frappe.render_template("form_sidebar", {doctype: this.frm.doctype, frm:this.frm}); | 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 = $('<div class="form-sidebar overlay-sidebar hidden-xs hidden-sm"></div>') | |||||
this.sidebar = $('<div class="form-sidebar overlay-sidebar hidden-xs hidden-sm"></div>') | |||||
.html(sidebar_content) | .html(sidebar_content) | ||||
.appendTo(this.page.sidebar.empty()); | .appendTo(this.page.sidebar.empty()); | ||||
this.sidebar = this.page_sidebar.add(this.offcanvas_form_sidebar); | |||||
this.comments = this.sidebar.find(".sidebar-comments"); | this.comments = this.sidebar.find(".sidebar-comments"); | ||||
this.user_actions = this.sidebar.find(".user-actions"); | this.user_actions = this.sidebar.find(".user-actions"); | ||||
this.image_section = this.sidebar.find(".sidebar-image-section"); | this.image_section = this.sidebar.find(".sidebar-image-section"); | ||||
@@ -37,7 +35,6 @@ frappe.ui.form.Sidebar = Class.extend({ | |||||
// scroll to comments | // scroll to comments | ||||
this.comments.on("click", function() { | this.comments.on("click", function() { | ||||
$(".offcanvas").removeClass("active-left active-right"); | |||||
frappe.utils.scroll_to(me.frm.footer.wrapper.find(".form-comments"), true); | frappe.utils.scroll_to(me.frm.footer.wrapper.find(".form-comments"), true); | ||||
}); | }); | ||||
@@ -18,13 +18,10 @@ frappe.views.ListSidebar = Class.extend({ | |||||
make: function() { | make: function() { | ||||
var sidebar_content = frappe.render_template("list_sidebar", {doctype: this.doclistview.doctype}); | 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 = $('<div class="list-sidebar overlay-sidebar hidden-xs hidden-sm"></div>') | |||||
this.sidebar = $('<div class="list-sidebar overlay-sidebar hidden-xs hidden-sm"></div>') | |||||
.html(sidebar_content) | .html(sidebar_content) | ||||
.appendTo(this.page.sidebar.empty()); | .appendTo(this.page.sidebar.empty()); | ||||
this.sidebar = this.page_sidebar.add(this.offcanvas_list_sidebar); | |||||
this.setup_reports(); | this.setup_reports(); | ||||
this.setup_assigned_to_me(); | this.setup_assigned_to_me(); | ||||
this.setup_list_view_switching(); | 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() { | this.page.sidebar.find(".assigned-to-me a").on("click", function() { | ||||
me.doclistview.assigned_to_me(); | 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() { | setup_list_view_switching: function() { | ||||
var me = this; | var me = this; | ||||
@@ -8,9 +8,7 @@ frappe.ui.toolbar.Toolbar = Class.extend({ | |||||
var header = $('header').append(frappe.render_template("navbar", { | var header = $('header').append(frappe.render_template("navbar", { | ||||
avatar: frappe.avatar(frappe.session.user) | 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 () { | header.find(".toggle-sidebar").on("click", function () { | ||||
var layout_side_section = $('.layout-side-section'); | var layout_side_section = $('.layout-side-section'); | ||||
var overlay_sidebar = layout_side_section.find('.overlay-sidebar'); | 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() { | $(document).on("notification-update", function() { | ||||
frappe.ui.notifications.update_notifications(); | frappe.ui.notifications.update_notifications(); | ||||
}); | }); | ||||
@@ -83,10 +76,6 @@ $.extend(frappe.ui.toolbar, { | |||||
frappe.ui.toolbar.get_menu(menu) : menu; | frappe.ui.toolbar.get_menu(menu) : menu; | ||||
$('<li class="divider custom-menu"></li>').prependTo(menu); | $('<li class="divider custom-menu"></li>').prependTo(menu); | ||||
}, | |||||
toggle_left_sidebar: function() { | |||||
$(".offcanvas").toggleClass("active-left").removeClass("active-right"); | |||||
return false; | |||||
} | } | ||||
}); | }); | ||||
@@ -114,6 +114,7 @@ _f.Frm.prototype.setup = function() { | |||||
frm: this, | frm: this, | ||||
parent: $('<div>').appendTo(this.page.main.parent()) | parent: $('<div>').appendTo(this.page.main.parent()) | ||||
}) | }) | ||||
$("body").attr("data-sidebar", 1); | |||||
} | } | ||||
this.setup_drag_drop(); | this.setup_drag_drop(); | ||||
@@ -96,14 +96,6 @@ | |||||
</footer> | </footer> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="modal-backdrop offcanvas-main-section-overlay"></div> | |||||
<div class="sidebar sidebar-right visible-xs"> | |||||
{% block offcanvas_sidebar -%} | |||||
<div class="sidebar-navbar-items"> | |||||
{% include "templates/includes/navbar/navbar_items.html" %} | |||||
</div> | |||||
{%- endblock %} | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -80,14 +80,6 @@ | |||||
{%- block footer -%}{% include "templates/includes/footer/footer.html" %}{%- endblock -%} | {%- block footer -%}{% include "templates/includes/footer/footer.html" %}{%- endblock -%} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="modal-backdrop offcanvas-main-section-overlay"></div> | |||||
<div class="sidebar sidebar-right visible-xs"> | |||||
{% block offcanvas_sidebar -%} | |||||
<div class="sidebar-navbar-items"> | |||||
{% include "templates/includes/navbar/navbar_items.html" %} | |||||
</div> | |||||
{%- endblock %} | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -296,7 +296,6 @@ $.extend(frappe, { | |||||
if(e.which===13 && val) { | if(e.which===13 && val) { | ||||
$(this).val("").blur(); | $(this).val("").blur(); | ||||
frappe.do_search(val); | frappe.do_search(val); | ||||
$(".offcanvas").removeClass("active-left active-right"); | |||||
return false; | return false; | ||||
} | } | ||||
}); | }); | ||||
@@ -375,21 +374,6 @@ $(document).ready(function() { | |||||
frappe.bind_navbar_search(); | 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 | // switch to app link | ||||
if(getCookie("system_user")==="yes" && logged_in) { | if(getCookie("system_user")==="yes" && logged_in) { | ||||
$("#website-post-login .dropdown-menu").append('<li><a href="/desk">Switch To Desk</a></li>'); | $("#website-post-login .dropdown-menu").append('<li><a href="/desk">Switch To Desk</a></li>'); | ||||
@@ -29,11 +29,6 @@ | |||||
<div id="body_div"></div> | <div id="body_div"></div> | ||||
<footer></footer> | <footer></footer> | ||||
</div> | </div> | ||||
<div class="modal-backdrop offcanvas-main-section-overlay"></div> | |||||
<div class="sidebar sidebar-left visible-xs visible-sm"></div> | |||||
<div class="sidebar sidebar-right visible-xs visible-sm"> | |||||
<ul class="list-unstyled sidebar-menu" id="sidebar-notification"></ul> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||