From 7e35fc28529677d95da1fbc7ded64a4be7604a65 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 20 Sep 2013 12:26:00 +0200 Subject: [PATCH] [FIX] website snippet: height vertical drop zone bzr revid: chm@openerp.com-20130920102600-jq8gv86i9ybqdf4d --- addons/website/static/src/js/website.snippets.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js index 45733a211f1..8f0ebf46d8a 100644 --- a/addons/website/static/src/js/website.snippets.js +++ b/addons/website/static/src/js/website.snippets.js @@ -425,8 +425,18 @@ self.dom_filter(vertical_child_selector).each(function (){ var $zone = $(this); var $template = $(zone_template).addClass("oe_vertical").css('height', $zone.outerHeight()+'px'); - $zone.find('> *:not(.oe_drop_zone):visible').after($template); - $zone.prepend($template.clone()); + var nb = 0; + $zone.find('> *:not(.oe_drop_zone):visible').each(function () { + $template.css('height', $(this).outerHeight()+'px'); + $(this).after($template.clone()); + if (!nb) { + $(this).before($template.clone()); + } + nb ++; + }); + if (!nb) { + $zone.prepend($template.clone()); + } }); }