//'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',
}),
this._super(parent, editor, media);
},
start: function () {
+ var self = this;
var res = this._super();
var o = { url: null };
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;
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));
},
</t>
<t t-name="website.editor.dialog.image.existing.content">
<div class="existing-attachments">
- <ul class="pager">
- <li class="previous disabled"><a href="#">← Previous</a></li>
- <li class="next disabled"><a href="#">Next →</a></li>
- </ul>
<div class="row mt16" t-foreach="rows" t-as="row">
<div class="col-sm-2 existing-attachment-cell"
t-foreach="row" t-as="attachment">
<div data-snippet-option-id='media'
data-selector="img:not(.cke_iframe), .media_iframe_video, span.fa, i.fa, .glyphicon">
- <li><a href="#" class="edition">Change Media</a></li>
+ <li><a href="#" class="edition">Change...</a></li>
</div>
<div data-snippet-option-id='transform'
<li data-value="fa-spin"><a>Spin</a></li>
</ul>
</li>
- <li><a href="#" class="clear-style">Clear Style</a></li>
+ <li><a href="#" class="clear-style">Reset Style</a></li>
</div>
</template>