@ucd-lib/theme-elements 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -115,26 +115,26 @@ export default class UcdThemePagination extends LitElement {
115
115
  }
116
116
 
117
117
  /**
118
- * @method updated()
119
- * @description Changes occur on update
118
+ * @method willUpdate()
119
+ * @description Changes before updated
120
120
  */
121
- updated(props3) {
122
- if( props3.has('currentPage') ) {
121
+ willUpdate(props) {
122
+ if( props.has('currentPage') || props.has('maxPages') ) {
123
123
 
124
- if(this.xs_screen && this.screen_check) {
124
+ if( this.xs_screen && this.screen_check ) {
125
125
  let pages = [this.currentPage];
126
126
  this._pages = pages; // Mobile Pagination
127
- }else{
128
- if(this.ellipses && this.maxPages >= 8){
127
+ } else {
128
+ if( this.ellipses && this.maxPages >= 8 ) {
129
129
  this._pages = this._renderEllipse();
130
- }else if(this.ellipses && this.maxPages < 8){
130
+ } else if ( this.ellipses && this.maxPages < 8 ) {
131
131
  this._pages = this._renderOriginal();
132
- }else {
132
+ } else {
133
133
  let startIndex = Math.floor(this.currentPage - (this.visibleLinkCount/2));
134
134
 
135
135
  if( startIndex < 0 ) {
136
136
  startIndex = 0;
137
- } else if( (this.currentPage + (this.visibleLinkCount/2)) > this.maxPages ) {
137
+ } else if ( (this.currentPage + (this.visibleLinkCount/2)) > this.maxPages ) {
138
138
  startIndex -= Math.ceil(this.currentPage + (this.visibleLinkCount/2)) - this.maxPages - 1;
139
139
  }
140
140
  if( startIndex < 0 ) {
@@ -150,9 +150,7 @@ export default class UcdThemePagination extends LitElement {
150
150
  }
151
151
  this._pages = pages;
152
152
  }
153
-
154
153
  } // Desktop Pagination
155
-
156
154
  }
157
155
  }
158
156
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucd-lib/theme-elements",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Custom elements for the UCD brand theme",
5
5
  "main": "index.js",
6
6
  "scripts": {