summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2018-04-05 10:12:48 +0200
committerSimon Rettberg2018-04-05 10:12:48 +0200
commit0b12472b6ecb09b5053c50bca9e8f13e4f367af3 (patch)
treeaa80e60b960a0084f3fb3000d8741ed9f84ae70a
parent[locationinfo] Delete according runmode entries when a panel gets deleted (diff)
downloadslx-admin-0b12472b6ecb09b5053c50bca9e8f13e4f367af3.tar.gz
slx-admin-0b12472b6ecb09b5053c50bca9e8f13e4f367af3.tar.xz
slx-admin-0b12472b6ecb09b5053c50bca9e8f13e4f367af3.zip
[locationinfo] Fix color of seat counter not updating properly
-rw-r--r--modules-available/locationinfo/frontend/frontendscript.js2
-rwxr-xr-xmodules-available/locationinfo/templates/frontend-default.html9
2 files changed, 5 insertions, 6 deletions
diff --git a/modules-available/locationinfo/frontend/frontendscript.js b/modules-available/locationinfo/frontend/frontendscript.js
index bad6a8ed..b5f59792 100644
--- a/modules-available/locationinfo/frontend/frontendscript.js
+++ b/modules-available/locationinfo/frontend/frontendscript.js
@@ -42,7 +42,7 @@ function toInt(str) {
* computes the time difference between 2 Date objects
* @param {Date} a
* @param {Date} b
- * @param {Array} globalConfig
+ * @param {Object} globalConfig
* @returns {string} printable time
*/
function GetTimeDiferenceAsString(a, b, globalConfig) {
diff --git a/modules-available/locationinfo/templates/frontend-default.html b/modules-available/locationinfo/templates/frontend-default.html
index e457f68d..006d2661 100755
--- a/modules-available/locationinfo/templates/frontend-default.html
+++ b/modules-available/locationinfo/templates/frontend-default.html
@@ -369,7 +369,6 @@ optional:
</div>
</body>
-<!--suppress RedundantIfStatementJS -->
<script type="text/javascript">
var rooms = {};
var lastRoomUpdate = 0;
@@ -983,7 +982,7 @@ optional:
if (room.config.scaledaysauto) {
var result = ($cal.weekCalendar("option", "daysToShow") * columnWidth) / 130;
- result = parseInt(Math.min(Math.max(Math.abs(result), 1), 7));
+ result = Math.min(Math.max(Math.abs(result), 1), 7);
if (result !== $cal.weekCalendar("option", "daysToShow")) {
$cal.weekCalendar("option", "daysToShow", result);
columnWidth = $cal.find(".wc-day-1").width();
@@ -1107,10 +1106,10 @@ optional:
/**
* Sets the free PCs number in the right corner and updates the square color accordingly
* @param room Room
- * @param seats Number of free PC's in the room
*/
function SetFreeSeats(room) {
room.$.seatsCounter.text(room.freePcs >= 0 ? room.freePcs : '');
+ room.$.seatsCounter.data('state', JSON.stringify(room.state));
if (room.freePcs > 0 && room.state && room.state.free) {
room.$.seatsBackground.css('background-color', '#250');
} else if (room.freePcs === -1) {
@@ -1153,7 +1152,7 @@ optional:
if (newTime !== false) {
room.$.currentRemain.text(newTime);
}
- if (room.lastFreeSeats !== seats) {
+ if (room.lastFreeSeats !== seats || !same) {
SetFreeSeats(room);
room.lastFreeSeats = seats;
}
@@ -1224,7 +1223,7 @@ optional:
console.log('getNextEvent called with something not array: ' + typeof(calEvents));
return null;
}
- var event;
+ var event = null;
var now = MyDate();
for (var i = 0; i < calEvents.length; i++) {
//event is now active