ninegrid2 6.315.0 → 6.317.0

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.
@@ -19,9 +19,9 @@ class aiMessage extends HTMLElement
19
19
  </style>
20
20
 
21
21
  <div class="chat-message">
22
- <div title="${this.#message}" class="message">
22
+ <span title="${this.#message}" class="message">
23
23
  ${this.#message}
24
- </div>
24
+ </span>
25
25
  <span class="more" style="position:relative;"><a href="#">more</a></span>
26
26
  </div>
27
27
 
@@ -45,6 +45,8 @@ class aiMessage extends HTMLElement
45
45
  console.log(v);;
46
46
  }
47
47
 
48
+
49
+
48
50
  #init = () => {
49
51
 
50
52
  const html = `
@@ -81,27 +83,7 @@ class aiMessage extends HTMLElement
81
83
  alert(this.#message);
82
84
  });
83
85
 
84
- setTimeout(() => {
85
- const elMessage = this.shadowRoot.querySelector(".message");
86
- const elMore = this.shadowRoot.querySelector(".more");
87
-
88
- console.log(elMessage.scrollWidth, elMessage.clientWidth);
89
-
90
- elMore.style.display = "flex";
91
- //elMore.style.position = "absolute";
92
-
93
- console.log(elMessage.scrollWidth, elMessage.clientWidth);
94
-
95
- //elMore.style.display = (elMessage.scrollWidth > elMessage.clientWidth) ? "flex" : "none";
96
- if (elMessage.scrollWidth > elMessage.clientWidth) {
97
- //elMore.style.display = "flex";
98
- //elMore.style.position = "absolute";
99
- }
100
- else {
101
- //elMore.style.display = "none";
102
- }
103
- }, 100);
104
-
86
+ this.shadowRoot.querySelector(".more").style.display = (ninegrid.isEllipsis(this.shadowRoot.querySelector(".message"))) ? "flex" : "none";
105
87
  };
106
88
  }
107
89