Pārlūkot izejas kodu

now reloads the list on reconnect

master
mort pirms 8 gadiem
vecāks
revīzija
00c377e37d
2 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  1. 1
    1
      package.json
  2. 5
    2
      web/script.js

+ 1
- 1
package.json Parādīt failu

@@ -10,7 +10,7 @@
"license": "ISC",
"dependencies": {
"express": "^4.13.4",
"webevents": "^1.0.2"
"webevents": "^1.1.1"
},
"devDependencies": {},
"description": ""

+ 5
- 2
web/script.js Parādīt failu

@@ -186,8 +186,11 @@ events.on("remove", function(evt) {
remove(evt.index);
});

get("/list", function(err, list) {
list.forEach(function(word, index) { add(word, index); });
events.on("connection", function() {
clearChildren(elemList);
get("/list", function(err, list) {
list.forEach(function(word, index) { add(word, index); });
});
});

get("/words", function(err, w) {

Notiek ielāde…
Atcelt
Saglabāt