diff --git a/src/App.vue b/src/App.vue index 4b3a7c9..e3c63e0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -94,17 +94,18 @@
- - - No results found for - - - Showing {{ filteredTools.length }} results out of {{ tools.length }} records for - +
+ No results found for "{{ search }}" - +
+
+ Showing {{ start }} – {{ end }} of {{ filteredTools.length }} results + + for "{{ search }}" + +
@@ -227,6 +240,9 @@ export default { loading: true, emptyResponse: false, failure: false, + start: 0, + end: 0, + total: 0, searchOptions: { shouldSort: true, threshold: 0.4, @@ -313,6 +329,7 @@ export default { }, async mounted() { + this.setPerPage(); this.getAllTopics(); await this.getAllTools(); this.getFeaturedTools(); @@ -327,7 +344,6 @@ export default { }); }); - this.setPerPage(); addEventListener('resize', (event) => { this.setPerPage(); }); @@ -473,6 +489,7 @@ export default { await this.filterByTopic(); await this.filterBySearch(); await this.checkEmpty(); + await this.getPaginationRange(); }, filterByTopic: function() { @@ -502,6 +519,21 @@ export default { } }, + getPaginationRange: function () { + console.log(this.$refs.paginator); + console.log(this.$refs.paginator.pageItemsCount); + let rangeRegex = /^(\d+)-(\d+) of (\d+)$/; + let matches = rangeRegex.exec(this.$refs.paginator.pageItemsCount); + console.log(matches); + + if (matches != null) { + this.start = matches[1]; + this.end = matches[2]; + // this.total = tools.length; + } + return; + }, + toggleTopics: function() { this.showTopics = this.showTopics ? false : true; }, @@ -522,7 +554,8 @@ export default { * @desc scrolls to top from paginate buttons */ scrollToTop : function () { - document.getElementById('search-bar-label').scrollIntoView({ + window.scrollTo({ + top: 0, behavior: 'smooth', }); }, @@ -622,10 +655,10 @@ export default { .filter-button{ font-family: "Open Sans", Helvetica, Roboto, Arial, sans-serif; - margin: 0px 8px 0px 0px; + margin: 12px 16px 8px 0px; padding: 6px; - border: 2px solid transparent; border-radius: 4px; + border: 2px solid transparent; background-color: #cfcfcf; color: #333333; line-height: normal; @@ -642,11 +675,9 @@ export default { border-color: #2176d2; } - .result-summary { - margin-right: 8px; - } - .clear-search-button{ + margin-top: 12px; + padding: 0px; border: none; background-color: transparent; color: #0f4d90; @@ -655,6 +686,10 @@ export default { text-decoration: underline; } + .helper-text { + margin-top: 1rem; + } + .clear-button { color: #ffffff; background-color: #0F4D90;