Skip to content

Commit

Permalink
[FIX] website_slides: fix slide loading (function call with wrong this)
Browse files Browse the repository at this point in the history
Strangelly, this worked in 9.0 as the `this` element refers to the
`window` which also contains the `$` function. This may still be
wrong in some cases though, so it is fixed here (even if reported for
10.0).

opw-(1)817789
  • Loading branch information
qsm-odoo committed Feb 23, 2018
1 parent cd21ea4 commit 216d73d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/website_slides/static/src/js/slides_embed.js
Expand Up @@ -50,12 +50,12 @@ $(document).ready(function () {
},
// page switching
render_page: function (page_number) {
this.pdf_viewer.renderPage(page_number).then(this.on_rendered_page);
this.pdf_viewer.renderPage(page_number).then(this.on_rendered_page.bind(this));
},
change_page: function () {
var page_asked = parseInt(this.$('#page_number').val(), 10);
if(1 <= page_asked && page_asked <= this.pdf_viewer.pdf_page_total){
this.pdf_viewer.changePage(page_asked).then(this.on_rendered_page);
this.pdf_viewer.changePage(page_asked).then(this.on_rendered_page.bind(this));
}else{
// if page number out of range, reset the page_counter to the actual page
this.$('#page_number').val(this.pdf_viewer.pdf_page_current);
Expand Down

0 comments on commit 216d73d

Please sign in to comment.