fix time to show/hide on edit view

This commit is contained in:
Reaby committed 2019-05-15 02:02:18 +03:00
1 parent 620e8d9929
commit 1b4b3d98f0
1 file changed
+18 -1
+18 -1
View File
@@ -148,6 +148,7 @@ function displayTime() {
if (min < 10) min = "0" + min;
var time = date.getHours() + ":" + min;
$('#time2').html(time);
checkTimeDisplay();
}
function setAlign(align) {
@@ -271,7 +272,7 @@ socket.on('callback.edit', function (data) {
} else {
nextSlide(data, true);
}
checkTimeDisplay();
setBackground(bundleData.background);
});
@@ -355,6 +356,22 @@ function drawGrid() {
canvas.renderAll();
}
function checkTimeDisplay() {
if ($("#override").checkbox('is checked')) {
if ($("#displaytime").checkbox('is checked')) {
$('#time2').removeClass('flipOutX').addClass("flipInX");
} else {
$('#time2').addClass('flipOutX').removeClass("flipInX");
}
} else {
if (bundleData.displayTime) {
$('#time2').removeClass('flipOutX').addClass("flipInX");
} else {
$('#time2').addClass('flipOutX').removeClass("flipInX");
}
}
}
function nextSlide(data) {
canvas.loadFromJSON(data.json, function () {
drawGrid();