[imp] modified web client to be a div instead of a body

bzr revid: nicolas.vanhoren@openerp.com-20120104113555-yiudv22gxr4s3k6k
This commit is contained in:
niv-openerp 2012-01-04 12:35:55 +01:00
parent 2ed427b5db
commit dcef579eae
5 changed files with 13 additions and 7 deletions

View File

@ -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().replace($("body"));',
'init': 'new s.web.WebClient().appendTo($("body"));',
}
return r

View File

@ -1,4 +1,10 @@
body.openerp {
body {
margin: 0;
height: 100%;
}
.openerp {
padding: 0;
margin: 0;
height: 100%;
@ -7,7 +13,7 @@ body.openerp {
font-family: Ubuntu, Helvetica, sans-serif;
}
body.openerp, .openerp textarea, .openerp input, .openerp select, .openerp option, .openerp button, .openerp .ui-widget {
.openerp, .openerp textarea, .openerp input, .openerp select, .openerp option, .openerp button, .openerp .ui-widget {
font-family: Ubuntu, Helvetica, sans-serif;
font-size:85%;
}

View File

@ -1064,7 +1064,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
this._current_state = null;
},
render_element: function() {
this.$element = $('<body/>');
this.$element = $('<div/>');
this.$element.attr("id", "oe");
this.$element.addClass("openerp");
},

View File

@ -502,7 +502,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
.attr('action', ajax.url + '?' + $.param(data))
.append($('<input type="hidden" name="r" />').attr('value', payload_str))
.hide()
.appendTo($('body'));
.appendTo($('.openerp'));
var cleanUp = function() {
if ($iframe) {
$iframe.unbind("load").attr("src", "javascript:false;").remove();

View File

@ -1544,7 +1544,7 @@ openerp.web.form.FieldText = openerp.web.form.Field.extend({
_.each('font-family,font-size,white-space'.split(','), function(style) {
$div.css(style, $input.css(style));
});
$div.appendTo($('body'));
$div.appendTo($(".openerp"));
new_height = $div.height();
if (new_height < 90) {
new_height = 90;
@ -3155,7 +3155,7 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({
var div = $("<div></div>");
div.css("display", "none");
div.css("color", color);
div.appendTo($("body"));
div.appendTo($(".openerp"));
var ncolor = div.css("color");
div.remove();
var res = /^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/.exec(ncolor);