Skip to content

Commit

Permalink
Fix broken status indication in textarea example
Browse files Browse the repository at this point in the history
  • Loading branch information
hamoid authored May 19, 2019
1 parent 1ff8798 commit 2fb0637
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/textarea/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ var connection = new sharedb.Connection(socket);

var element = document.querySelector('textarea');
var statusSpan = document.getElementById('status-span');
status.innerHTML = "Not Connected"
statusSpan.innerHTML = "Not Connected"

element.style.backgroundColor = "gray";
socket.onopen = function(){
status.innerHTML = "Connected"
statusSpan.innerHTML = "Connected"
element.style.backgroundColor = "white";
};

socket.onclose = function(){
status.innerHTML = "Closed"
statusSpan.innerHTML = "Closed"
element.style.backgroundColor = "gray";
};

socket.onerror = function() {
status.innerHTML = "Error"
statusSpan.innerHTML = "Error"
element.style.backgroundColor = "red";
}

Expand Down

0 comments on commit 2fb0637

Please sign in to comment.