diff options
| author | chm@openerp.com <> | 2014-04-08 10:42:37 +0200 |
|---|---|---|
| committer | chm@openerp.com <> | 2014-04-08 10:42:37 +0200 |
| commit | df9225295208a30fb994f81215cf8e8fecc5c760 (patch) | |
| tree | 37d740aededfbf22dc1358365f272820607cbc01 /addons/website/static/src/js/website.editor.js | |
| parent | 781e8fbbf09867e1e9b6f29839902ded6f6ba6a8 (diff) | |
[FIX] website media editor: next previous
bzr revid: chm@openerp.com-20140408084237-y8yh8cb1gsv94gbo
Diffstat (limited to 'addons/website/static/src/js/website.editor.js')
| -rw-r--r-- | addons/website/static/src/js/website.editor.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 7c2ed281a04..c09f9a6b02f 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -1457,15 +1457,6 @@ //'change input.url': 'preview_image', //'change select.image-style': 'preview_image', 'click .existing-attachments img': 'select_existing', - 'click .pager > li': function (e) { - e.preventDefault(); - var $target = $(e.currentTarget); - if ($target.hasClass('disabled')) { - return; - } - this.page += $target.hasClass('previous') ? -1 : 1; - this.display_attachments(); - }, 'click .existing-attachment-remove': 'try_remove', }), @@ -1474,6 +1465,7 @@ this._super(parent, editor, media); }, start: function () { + var self = this; var res = this._super(); var o = { url: null }; @@ -1481,6 +1473,16 @@ Object.preventExtensions(o); this.trigger('start', o); + this.parent.$(".pager > li").click(function (e) { + e.preventDefault(); + var $target = $(e.currentTarget); + if ($target.hasClass('disabled')) { + return; + } + self.page += $target.hasClass('previous') ? -1 : 1; + self.display_attachments(); + }); + this.set_image(o.url); return res; @@ -1590,7 +1592,7 @@ this.$('.existing-attachments').replaceWith( openerp.qweb.render( 'website.editor.dialog.image.existing.content', {rows: rows})); - this.$('.pager') + this.parent.$('.pager') .find('li.previous').toggleClass('disabled', (from === 0)).end() .find('li.next').toggleClass('disabled', (from + per_screen >= records.length)); }, |
