[imp] nivified web client
authorniv-openerp <nicolas.vanhoren@openerp.com>
Wed, 4 Jan 2012 09:12:22 +0000 (10:12 +0100)
committerniv-openerp <nicolas.vanhoren@openerp.com>
Wed, 4 Jan 2012 09:12:22 +0000 (10:12 +0100)
bzr revid: nicolas.vanhoren@openerp.com-20120104091222-y5m7sacecxu1zmeb

addons/web/controllers/main.py
addons/web/static/src/js/chrome.js

index cf379e1..65002d5 100644 (file)
@@ -89,7 +89,7 @@ html_template = """<!DOCTYPE html>
             });
         </script>
     </head>
-    <body id="oe" class="openerp"></body>
+    <body></body>
 </html>
 """
 
@@ -197,7 +197,7 @@ class WebClient(openerpweb.Controller):
             'js': js,
             'css': css,
             'modules': simplejson.dumps(self.server_wide_modules(req)),
-            'init': 'new s.web.WebClient("oe").start();',
+            'init': 'new s.web.WebClient().replace($("body"));',
         }
         return r
 
index 19d1288..8c0c66a 100644 (file)
@@ -1060,9 +1060,9 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
      *
      * @param element_id
      */
-    init: function(element_id) {
+    init: function(parent) {
         var self = this;
-        this._super(null, element_id);
+        this._super(parent);
         openerp.webclient = this;
 
         this.notification = new openerp.web.Notification(this);
@@ -1076,8 +1076,12 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
 
         this._current_state = null;
     },
+    render_element: function() {
+        this.$element = $('<body/>');
+        this.$element.attr("id", "oe");
+        this.$element.addClass("openerp");
+    },
     start: function() {
-        this._super.apply(this, arguments);
         var self = this;
         this.session.bind().then(function() {
             var params = {};