handle span colour when there are fewer spans than users
This commit is contained in:
parent
69753dac66
commit
82a487d3dd
11
owe.js
11
owe.js
@ -31,11 +31,14 @@ function loadSentences(alertIfNew = false, increaseUnread = true) {
|
|||||||
|
|
||||||
// color
|
// color
|
||||||
var spans = document.querySelector(".sentences").getElementsByTagName("span");
|
var spans = document.querySelector(".sentences").getElementsByTagName("span");
|
||||||
// we expect this to be from the user who's turn it is now
|
|
||||||
var histurnspan = spans[spans.length - config_data.users.length];
|
|
||||||
//console.log(histurnspan.getAttribute("style"));
|
|
||||||
document.getElementById("wordinput").setAttribute("style", histurnspan.getAttribute("style"));
|
|
||||||
|
|
||||||
|
if (spans.length >= config_data.users.length) {
|
||||||
|
var histurnspan = spans[spans.length - config_data.users.length];
|
||||||
|
//console.log(histurnspan.getAttribute("style"));
|
||||||
|
document.getElementById("wordinput").setAttribute("style", histurnspan.getAttribute("style"));
|
||||||
|
} else {
|
||||||
|
console.error('Not enough spans available for users.');
|
||||||
|
}
|
||||||
initializeLoginArea();
|
initializeLoginArea();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user