Failed to execute template. Cause: [Access denied when checking [script] access to [xwiki:Collaboratory.UX.HbpSkin.WebHome] for user [xwiki:XWiki.Admin]]. Click on this message for details.

CLB Search Component - HBP Wiki

IAM21 instance, do not create collab nor modify a team, your changes will be lost


Changes for page CLB Search Component

Last modified by bougault on 2023/01/17 11:42

From version 7.21
edited by bougault
on 2023/01/13 14:33
Change comment: There is no comment for this version
To version 7.19
edited by bougault
on 2023/01/13 14:18
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -43,19 +43,22 @@
43 43   }
44 44  
45 45   connectedCallback() {
46 + // this.attachShadow({ mode: 'open' });
46 46   super.connectedCallback();
47 47   this.render();
48 - this.$('#search').addEventListener('click', this.handleSearch);
49 - this.$('#prev').addEventListener('click', this.handlePrevPage);
50 - this.$('#next').addEventListener('click', this.handleNextPage;
49 + this.$('#search').addEventListener('click', () => this.handleSearch());
50 + this.$('#prev').addEventListener('click', () => {
51 + if(this.offset > 0) {
52 + this.offset--;
53 + this.handleSearch();
54 + }
55 + });
56 + this.$('#next').addEventListener('click', () => {
57 + this.offset++;
58 + this.handleSearch();
59 + });
51 51   }
52 52  
53 - disconnectedCallback() {
54 - this.$('#search').removeEventListener('click', this.handleSearch;
55 - this.$('#prev').removeEventListener('click', this.handlePrevPage);
56 - this.$('#next').removeEventListener('click', this.handleNextPage);
57 - }
58 -
59 59   get styles() {
60 60   return `
61 61   input[type="text"] {
... ... @@ -63,16 +63,6 @@
63 63   }
64 64   `
65 65   }
66 - handlePrevPage = () => {
67 - if(this.offset > 0) {
68 - this.offset--;
69 - this.handleSearch();
70 - }
71 - }
72 - handleNextPage = () => {
73 - this.offset++;
74 - this.handleSearch();
75 - }
76 76  
77 77   handleSearch = () => {
78 78   const value = this.$('input[type="text"]').value;