add code_backend_theme from cybrosys
This commit is contained in:
parent
fb8b2fd9e0
commit
612b72778e
136 changed files with 4110 additions and 0 deletions
93
code_backend_theme/static/src/js/chrome/sidebar_menu.js
Normal file
93
code_backend_theme/static/src/js/chrome/sidebar_menu.js
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
odoo.define('code_backend_theme.SidebarMenu', function (require) {
|
||||
"use strict";
|
||||
|
||||
//sidebar toggle effect
|
||||
$(document).on("click", "#closeSidebar", function(event){
|
||||
$("#closeSidebar").hide();
|
||||
$("#openSidebar").show();
|
||||
});
|
||||
$(document).on("click", "#openSidebar", function(event){
|
||||
$("#openSidebar").hide();
|
||||
$("#closeSidebar").show();
|
||||
});
|
||||
$(document).on("click", "#openSidebar", function(event){
|
||||
$("#sidebar_panel").css({'display':'block'});
|
||||
$(".o_action_manager").css({'margin-left': '200px','transition':'all .1s linear'});
|
||||
$(".top_heading").css({'margin-left': '200px','transition':'all .1s linear', 'width':'auto'});
|
||||
|
||||
//add class in navbar
|
||||
var navbar = $(".o_main_navbar");
|
||||
var navbar_id = navbar.data("id");
|
||||
$("nav").addClass(navbar_id);
|
||||
navbar.addClass("small_nav");
|
||||
|
||||
//add class in action-manager
|
||||
var action_manager = $(".o_action_manager");
|
||||
var action_manager_id = action_manager.data("id");
|
||||
$("div").addClass(action_manager_id);
|
||||
action_manager.addClass("sidebar_margin");
|
||||
|
||||
//add class in top_heading
|
||||
var top_head = $(".top_heading");
|
||||
var top_head_id = top_head.data("id");
|
||||
$("div").addClass(top_head_id);
|
||||
top_head.addClass("sidebar_margin");
|
||||
});
|
||||
$(document).on("click", "#closeSidebar", function(event){
|
||||
$("#sidebar_panel").css({'display':'none'});
|
||||
$(".o_action_manager").css({'margin-left': '0px'});
|
||||
$(".top_heading").css({'margin-left': '0px', 'width':'100%'});
|
||||
|
||||
//remove class in navbar
|
||||
var navbar = $(".o_main_navbar");
|
||||
var navbar_id = navbar.data("id");
|
||||
$("nav").removeClass(navbar_id);
|
||||
navbar.removeClass("small_nav");
|
||||
|
||||
//remove class in action-manager
|
||||
var action_manager = $(".o_action_manager");
|
||||
var action_manager_id = action_manager.data("id");
|
||||
$("div").removeClass(action_manager_id);
|
||||
action_manager.removeClass("sidebar_margin");
|
||||
|
||||
//remove class in top_heading
|
||||
var top_head = $(".top_heading");
|
||||
var top_head_id = top_head.data("id");
|
||||
$("div").removeClass(top_head_id);
|
||||
top_head.removeClass("sidebar_margin");
|
||||
});
|
||||
|
||||
$(document).on("click", ".sidebar a", function(event){
|
||||
var menu = $(".sidebar a");
|
||||
var $this = $(this);
|
||||
var id = $this.data("id");
|
||||
$("header").removeClass().addClass(id);
|
||||
menu.removeClass("active");
|
||||
$this.addClass("active");
|
||||
|
||||
//sidebar close on menu-item click
|
||||
$("#sidebar_panel").css({'display':'none'});
|
||||
$(".o_action_manager").css({'margin-left': '0px'});
|
||||
$(".top_heading").css({'margin-left': '0px', 'width':'100%'});
|
||||
$("#closeSidebar").hide();
|
||||
$("#openSidebar").show();
|
||||
|
||||
//remove class in navbar
|
||||
var navbar = $(".o_main_navbar");
|
||||
var navbar_id = navbar.data("id");
|
||||
$("nav").removeClass(navbar_id);
|
||||
navbar.removeClass("small_nav");
|
||||
|
||||
//remove class in action-manager
|
||||
var action_manager = $(".o_action_manager");
|
||||
var action_manager_id = action_manager.data("id");
|
||||
$("div").removeClass(action_manager_id);
|
||||
action_manager.removeClass("sidebar_margin");
|
||||
|
||||
//remove class in top_heading
|
||||
var top_head = $(".top_heading");
|
||||
var top_head_id = top_head.data("id");
|
||||
$("div").removeClass(top_head_id);
|
||||
top_head.removeClass("sidebar_margin");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue