Bhumi Thakkar (Open ERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-bug-907642-bth into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-907642-bth/+merge/88854

Hello,

I have changed code as required. clicked menu id i have passed to show current 
menu in side bar menu.


Thanks,
Bhumi Thakkar (BTH)

-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-907642-bth/+merge/88854
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-bug-907642-bth.
=== modified file 'addons/web/static/src/js/chrome.js'
--- addons/web/static/src/js/chrome.js	2012-01-17 12:00:35 +0000
+++ addons/web/static/src/js/chrome.js	2012-01-17 13:45:39 +0000
@@ -860,7 +860,10 @@
         var self = this;
         return this.rpc("/web/menu/load", {}, this.on_loaded).then(function () {
             if (self.current_menu) {
-                self.open_menu(self.current_menu);
+                self.open_menu(self.current_menu)
+            }
+            else if (window.localStorage.clickmenuid) {
+                self.open_menu(window.localStorage.clickmenuid);
             }
         });
     },
@@ -905,6 +908,12 @@
                     $secondary_submenu.addClass('opened')
                 }
                 var $parent = $secondary_submenu.parent().show();
+                _.each($parent.find('.opened'),function(i){
+                    if($secondary_submenu.attr('id')!=$(i).attr('id')){
+                        $(i).removeClass('opened');
+                        $(i).next().css('display','none');
+                    }
+                });
                 if ($parent.hasClass('oe_secondary_menu')) {
                     var primary_id = $parent.data('menu-parent');
                     $primary_menu = this.$element.find(
@@ -937,8 +946,10 @@
         } else {
             $clicked_menu = $(ev.currentTarget);
             id = $clicked_menu.data('menu');
+            if (window.localStorage) {
+                localStorage.setItem('clickmenuid', $clicked_menu.data('menu'));
+            }
         }
-
         if (this.do_menu_click($clicked_menu, manual) && id) {
             this.current_menu = id;
             this.session.active_id = id;
@@ -1150,6 +1161,9 @@
         this.session.session_logout();
         $(window).unbind('hashchange', this.on_hashchange);
         this.do_push_state({});
+        if (window.localStorage) {
+            localStorage.setItem('clickmenuid', '');
+        }
         //would be cool to be able to do this, but I think it will make addons do strange things
         //this.show_login();
         window.location.reload();

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to