Alfredo Villegas commited on
Commit ·
1e122c4
1
Parent(s): 229e6a9
DEV: switch button funciona
Browse files- static/js/chatHandler.js +2 -1
- static/js/windowHandler.js +9 -8
static/js/chatHandler.js
CHANGED
|
@@ -44,7 +44,8 @@ class ChatGPT{
|
|
| 44 |
this.reintentos++;
|
| 45 |
this.enviar("")
|
| 46 |
});
|
| 47 |
-
|
|
|
|
| 48 |
$(document).on("accion:switch_change", (event, params) => {
|
| 49 |
this.config.googleSearch = params;
|
| 50 |
console.log(this.config);
|
|
|
|
| 44 |
this.reintentos++;
|
| 45 |
this.enviar("")
|
| 46 |
});
|
| 47 |
+
// Signaling
|
| 48 |
+
// los on se escuchan cuando suena lo que se està disparando.
|
| 49 |
$(document).on("accion:switch_change", (event, params) => {
|
| 50 |
this.config.googleSearch = params;
|
| 51 |
console.log(this.config);
|
static/js/windowHandler.js
CHANGED
|
@@ -159,14 +159,15 @@ class WindowHandler{
|
|
| 159 |
|
| 160 |
|
| 161 |
}
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
|
|
|
|
|
|
| 169 |
}
|
| 170 |
-
}
|
| 171 |
|
| 172 |
}
|
|
|
|
| 159 |
|
| 160 |
|
| 161 |
}
|
| 162 |
+
|
| 163 |
+
toggleSwitch(event) {
|
| 164 |
+
let checkBox = event.currentTarget;
|
| 165 |
+
$(document).trigger("accion:switch_change", checkBox.checked);
|
| 166 |
+
if (checkBox.checked) {
|
| 167 |
+
console.log("Switch is turned on.");
|
| 168 |
+
} else {
|
| 169 |
+
console.log("Switch is turned off.");
|
| 170 |
+
}
|
| 171 |
}
|
|
|
|
| 172 |
|
| 173 |
}
|