summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2015-10-28 15:00:57 +0100
committerNicolas Lempereur <nle@odoo.com>2015-10-29 13:25:27 +0100
commit1da79c54a1bb7541e4e77e627908147b39087d67 (patch)
tree7cf860946715075e4947b0ebc82e5c32ac1366fd /addons/web_editor/static/src
parenta71caede2d5e58f751723dffe10eb0453cbdf974 (diff)
[FIX] web{site,_editor}: gallery upload image
* when getting the src of an uploaded attachment we have to use src which is by default url, * in a MediaDialog the pager is shared between the document and image dialog, but when changing page, it was done for both (even if not displayed), * select the image after uploading it in the ImageDialog. closes #9284 opw-653061 opw-653167
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/widgets.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js
index 71bd31eaaca..7508ce1c392 100644
--- a/addons/web_editor/static/src/js/widgets.js
+++ b/addons/web_editor/static/src/js/widgets.js
@@ -285,6 +285,9 @@ var ImageDialog = Widget.extend({
o.id = +o.url.match(/\/web\/content\/([0-9]*)/, '')[1];
}
this.parent.$(".pager > li").click(function (e) {
+ if(!self.$el.is(':visible')) {
+ return;
+ }
e.preventDefault();
var $target = $(e.currentTarget);
if ($target.hasClass('disabled')) {
@@ -303,7 +306,6 @@ var ImageDialog = Widget.extend({
var img = _.select(this.images, function (v) { return v.id == attachment.id;});
if (img.length) {
this.images.splice(this.images.indexOf(img[0]),1);
- return;
}
} else {
this.images = [];
@@ -421,11 +423,11 @@ var ImageDialog = Widget.extend({
var $button = this.$('button.filepicker');
if (!error) {
$button.addClass('btn-success');
+ this.set_image(attachment);
} else {
this.$('form').addClass('has-error')
.find('.help-block').text(error);
$button.addClass('btn-danger');
- this.set_image(attachment, error);
}
if (!this.options.select_images) {