@minhnd1010/chat-widget 1.0.4 → 1.0.6
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.
- package/index.js +23 -26
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -36,29 +36,27 @@ class ChatWidget extends HTMLElement {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
render() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
default:
|
|
61
|
-
// bottom-left
|
|
39
|
+
let position = "";
|
|
40
|
+
const top = this.getAttribute("top");
|
|
41
|
+
const left = this.getAttribute("left");
|
|
42
|
+
const bottom = this.getAttribute("bottom");
|
|
43
|
+
const right = this.getAttribute("right");
|
|
44
|
+
|
|
45
|
+
if (top) {
|
|
46
|
+
position += `top: ${top};`;
|
|
47
|
+
}
|
|
48
|
+
if (left) {
|
|
49
|
+
position += `left: ${left};`;
|
|
50
|
+
}
|
|
51
|
+
if (bottom) {
|
|
52
|
+
position += `bottom: ${bottom};`;
|
|
53
|
+
}
|
|
54
|
+
if (right) {
|
|
55
|
+
position += `right: ${right};`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (position) {
|
|
59
|
+
position = `bottom: 20px; left: 20px;`;
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
const template = document.createElement("template");
|
|
@@ -76,8 +74,7 @@ class ChatWidget extends HTMLElement {
|
|
|
76
74
|
================================================================================ */
|
|
77
75
|
.chat-container {
|
|
78
76
|
position: fixed;
|
|
79
|
-
|
|
80
|
-
left: 20px;
|
|
77
|
+
${position}
|
|
81
78
|
}
|
|
82
79
|
|
|
83
80
|
#chat-icon {
|
|
@@ -840,7 +837,7 @@ class ChatWidget extends HTMLElement {
|
|
|
840
837
|
// ================== USER INPUT ==================
|
|
841
838
|
let token = this.getAttribute("token");
|
|
842
839
|
|
|
843
|
-
let userId = this.getAttribute("
|
|
840
|
+
let userId = this.getAttribute("ma-doi-tac-nsd");
|
|
844
841
|
|
|
845
842
|
let fullName = this.getAttribute("ten");
|
|
846
843
|
|