Fix: player list manager, button style

This commit is contained in:
2018-10-30 17:58:10 +09:00
parent d7d6fd80d5
commit d3537128a3
5 changed files with 232 additions and 128 deletions
+5 -7
View File
@@ -22,6 +22,9 @@ function PlayerList(tagDiv, playerListManager) {
this.listRows = new Array();
for(var i = 0; i < id_list.length; i++) {
// console.log(playerEditButtonList[i]);
// console.log(playerDeleteButtonList[i]);
this.listRows[i] = new PlayerListRow(
id_list[i].getElementsByClassName("player_id"),
id_list[i].getElementsByClassName("player_name"),
@@ -30,6 +33,8 @@ function PlayerList(tagDiv, playerListManager) {
id_list[i].getElementsByClassName("player_delete")
);
$(this.listRows[i].playerID).empty();
$(this.listRows[i].editButton).click(function() {
playerListManager.editPlayer(this);
})
@@ -37,19 +42,14 @@ function PlayerList(tagDiv, playerListManager) {
$(this.listRows[i].deleteButton).click(function() {
playerListManager.deletePlayer(this);
})
// console.log(this.listRows[i]);
// console.log(this.listRows[i].playerName.val());
this.disableItem(this.listRows[i]);
}
}
PlayerList.prototype.disableItem = function(item) {
$(item.playerID).empty();
$(item.playerName).prop("disabled", true);
$(item.enterCode).prop("disabled", true);
// $(item.playerName).prop("readonly", true);
// $(item.enterCode).prop("readonly", true);
$(item.editButton).prop("disabled", true);
$(item.deleteButton).prop("disabled", true);
}
@@ -57,8 +57,6 @@ PlayerList.prototype.disableItem = function(item) {
PlayerList.prototype.enableItem = function(item) {
$(item.playerName).prop("disabled", false);
$(item.enterCode).prop("disabled", false);
// $(item.playerName).prop("readonly", false);
// $(item.enterCode).prop("readonly", false);
$(item.editButton).prop("disabled", false);
$(item.deleteButton).prop("disabled", false);
}