[FIX] website snippet: height vertical drop zone (include margin top and bottom)

bzr revid: chm@openerp.com-20130920103035-7fhpoxzuxqwmut2y
This commit is contained in:
Christophe Matthieu 2013-09-20 12:30:35 +02:00
parent 7e35fc2852
commit 8c265d7c98
1 changed files with 5 additions and 4 deletions

View File

@ -424,18 +424,19 @@
if(vertical_child_selector){
self.dom_filter(vertical_child_selector).each(function (){
var $zone = $(this);
var $template = $(zone_template).addClass("oe_vertical").css('height', $zone.outerHeight()+'px');
var $template = $(zone_template).addClass("oe_vertical");
var nb = 0;
$zone.find('> *:not(.oe_drop_zone):visible').each(function () {
$template.css('height', $(this).outerHeight()+'px');
$(this).after($template.clone());
var $col = $(this);
$template.css('height', ($col.outerHeight() + parseInt($col.css("margin-top")) + parseInt($col.css("margin-bottom")))+'px');
$col.after($template.clone());
if (!nb) {
$(this).before($template.clone());
}
nb ++;
});
if (!nb) {
$zone.prepend($template.clone());
$zone.prepend($template.css('height', $zone.outerHeight()+'px'));
}
});
}