@ucd-lib/theme-elements 1.2.1 → 1.2.3
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
|
|
119
|
-
* @description Changes
|
|
118
|
+
* @method willUpdate()
|
|
119
|
+
* @description Changes before updated
|
|
120
120
|
*/
|
|
121
|
-
|
|
122
|
-
if(
|
|
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
|
@@ -138,10 +138,10 @@ export default class UcdlibPages extends LitElement {
|
|
|
138
138
|
_select(value, child, attribute) {
|
|
139
139
|
if( value ) {
|
|
140
140
|
if( attribute ) child.setAttribute(attribute, attribute);
|
|
141
|
-
|
|
141
|
+
child.style.display = 'block';
|
|
142
142
|
} else {
|
|
143
143
|
if( attribute ) child.removeAttribute(attribute, attribute);
|
|
144
|
-
|
|
144
|
+
child.style.display = 'none';
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|