Skip to content

Commit

Permalink
⚡ add class 'active' to items in left and top panell
Browse files Browse the repository at this point in the history
Signed-off-by: Enigma228322 <[email protected]>
  • Loading branch information
Enigma228322 committed Nov 3, 2020
1 parent 2167056 commit faa37dd
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
27 changes: 27 additions & 0 deletions theme_kit/static/js/theme_kit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
odoo.define('theme_kit.model', function (require) {
"use strict";

var WebClient = require("web.WebClient");

WebClient.include({
init: function (parent) {
this._super.apply(this, arguments);
var self = this;
},
});
$(document).ready(function(e){
$('#odooMenuBarNav > div > div.o_sub_menu_content > ul > li > a').click(function (e) {
if($('#odooMenuBarNav > div > div.o_sub_menu_content > ul > li > a') != undefined){
$('#odooMenuBarNav > div > div.o_sub_menu_content > ul > li > a').removeClass("active");
$("#odooMenuBarNav > div > div.o_sub_menu_content > ul > li.active").removeClass("active")
}
$(e.target).addClass("active");
});
$("#sidebar > li > a").click(function(e){
if($("#sidebar > li > a") != undefined){
$("#sidebar > li > a").removeClass("active");
}
$(e.target).addClass("active");
});
});
});
12 changes: 12 additions & 0 deletions theme_kit/views/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@
</template>
<template id="theme_kit.dummy">
</template>
<template
id="theme_kit"
name="Theme kit JS"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<script
type="text/javascript"
src="/theme_kit/static/js/theme_kit.js"
/>
</xpath>
</template>
</odoo>

0 comments on commit faa37dd

Please sign in to comment.