diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-11-02 18:06:25 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-11-02 18:06:25 +0100 |
| commit | d5d8140f3aa3d022f9f3703a282d5b0df9499c8d (patch) | |
| tree | bc4ac9789e91c4facd0d1576046310d1ac519c5f /addons/website/static/src/js/website.snippets.gallery.js | |
| parent | f9efc14440a247af74bc65ca708b0df7f31f29cf (diff) | |
| parent | 7158eaf80dd7b2f03df5ed8258ec63665b8ad0c6 (diff) | |
[MERGE] forward port of branch saas-6 up to 7158eaf
Diffstat (limited to 'addons/website/static/src/js/website.snippets.gallery.js')
| -rw-r--r-- | addons/website/static/src/js/website.snippets.gallery.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/addons/website/static/src/js/website.snippets.gallery.js b/addons/website/static/src/js/website.snippets.gallery.js index a729b8a0c81..74f20e7a314 100644 --- a/addons/website/static/src/js/website.snippets.gallery.js +++ b/addons/website/static/src/js/website.snippets.gallery.js @@ -228,7 +228,7 @@ options.registry.gallery = options.Class.extend({ var $container = this.$target.find(".container:first"); var editor = new widget.MediaDialog(this.$target.closest('.o_editable'), null, {select_images: true}); editor.appendTo(document.body); - var index = Math.max(_.map(this.$target.find("img").get(), function (img) { return img.dataset.index | 0; })) + 1; + var index = Math.max(0, _.max(_.map(this.$target.find("img").get(), function (img) { return img.dataset.index | 0; })) + 1); editor.on('saved', this, function (attachments) { for (var i = 0 ; i < attachments.length; i++) { var img = $('<img class="img img-responsive mb8 mt8"/>') @@ -335,7 +335,6 @@ options.registry.gallery_img = options.Class.extend({ if (type !== "click") return; var $parent = this.$target.closest("section"); - this.buildingBlock.create_overlay($parent); var editor = $parent.data('snippet-editor').styles.gallery; var imgs = $parent.find('img').get(); imgs.sort(function (a,b) { return $(a).data('index')-$(b).data('index'); }); |
