From 24e87a724a1d76fd47c301d4b404e0e675aba119 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 21 Oct 2013 17:39:18 +0200 Subject: [PATCH] [IMP] uncomment for perf bzr revid: fp@tinyerp.com-20131021153918-zpnp0xhisorgg3ws --- .../website/static/src/js/website.snippets.js | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js index 477eadcd759..ee759e3d153 100644 --- a/addons/website/static/src/js/website.snippets.js +++ b/addons/website/static/src/js/website.snippets.js @@ -967,25 +967,23 @@ _drag_and_drop_after_insert_dropzone: function(){ var self = this; - // commented for perf - - // var $zones = $(".row:has(> .oe_drop_zone)").each(function () { - // var $row = $(this); - // var width = $row.innerWidth(); - // var pos = 0; - // while (width > pos + self.size.width) { - // var $last = $row.find("> .oe_drop_zone:last"); - // $last.each(function () { - // pos = $(this).position().left; - // }); - // if (width > pos + self.size.width) { - // $row.append("
"); - // var $add_drop = $last.clone(); - // $row.append($add_drop); - // self._drag_and_drop_active_drop_zone($add_drop); - // } - // } - // }); + var $zones = $(".row:has(> .oe_drop_zone)").each(function () { + var $row = $(this); + var width = $row.innerWidth(); + var pos = 0; + while (width > pos + self.size.width) { + var $last = $row.find("> .oe_drop_zone:last"); + $last.each(function () { + pos = $(this).position().left; + }); + if (width > pos + self.size.width) { + $row.append("
"); + var $add_drop = $last.clone(); + $row.append($add_drop); + self._drag_and_drop_active_drop_zone($add_drop); + } + } + }); }, _drag_and_drop_start: function () { this._super();