Skip to content

Commit

Permalink
dispatch pageChange event
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaudeta committed Nov 16, 2018
1 parent 2378ff2 commit 417225e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plutonium-pagination.html
Expand Up @@ -89,7 +89,8 @@
page: {
type: Number,
notify: true,
value: () => 1
value: () => 1,
observer: 'onPageChange'
},
/** Count of the pages displayed before or after the current page. */
size: {
Expand Down Expand Up @@ -163,7 +164,11 @@


}


onPageChange(newValue, oldValue){
this.dispatchEvent(new CustomEvent('pageChange', {detail: {newPage: newValue, oldPage:oldValue}}));
}

_firstIndex(page, size) {
let index = page - size;
if (index < 1) {
Expand Down

0 comments on commit 417225e

Please sign in to comment.