Skip to content

Commit

Permalink
Bind JavaScript functions to Pagination’s before callback
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Aug 22, 2022
1 parent a315cb5 commit e9ca971
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Plugins/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ class Pagination {
typeof this.data.pagination.before === "function"
) {
// we don’t need to make a copy of this because we .slice() above to create a new copy
result = this.data.pagination.before(result, this.data);
let fns = {};
if (this.config) {
fns = this.config.javascriptFunctions;
}
result = this.data.pagination.before.call(fns, result, this.data);
}

if (this.data.pagination.reverse === true) {
Expand Down

0 comments on commit e9ca971

Please sign in to comment.