mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Only send websocket message to update team FTA notes if notes changed.
This commit is contained in:
@@ -128,14 +128,16 @@ var handleEventStatus = function(data) {
|
||||
|
||||
// Makes the team notes section editable and handles saving edits to the server.
|
||||
var editFtaNotes = function(element) {
|
||||
var teamNotesElement = $(element);
|
||||
var teamNotesTextElement = $(element);
|
||||
var textArea = $("<textarea />");
|
||||
textArea.val(teamNotesElement.text());
|
||||
teamNotesElement.replaceWith(textArea);
|
||||
textArea.val(teamNotesTextElement.text());
|
||||
teamNotesTextElement.replaceWith(textArea);
|
||||
textArea.focus();
|
||||
textArea.blur(function() {
|
||||
textArea.replaceWith(teamNotesElement);
|
||||
websocket.send("updateTeamNotes", { station: teamNotesElement.attr("data-station"), notes: textArea.val()});
|
||||
textArea.replaceWith(teamNotesTextElement);
|
||||
if (textArea.val() !== teamNotesTextElement.text()) {
|
||||
websocket.send("updateTeamNotes", { station: teamNotesTextElement.attr("data-station"), notes: textArea.val()});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user