summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/templates/frontend-default.html
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-06 11:25:33 +0100
committerSimon Rettberg2017-12-06 11:25:33 +0100
commit65a4a13f26279d04ec75e1420d8527acdedfda54 (patch)
tree75133a8b858071dc1169085b33bd9805b4081b85 /modules-available/locationinfo/templates/frontend-default.html
parentMerge branch 'master' of dnbd3:openslx-ng/slx-admin (diff)
downloadslx-admin-65a4a13f26279d04ec75e1420d8527acdedfda54.tar.gz
slx-admin-65a4a13f26279d04ec75e1420d8527acdedfda54.tar.xz
slx-admin-65a4a13f26279d04ec75e1420d8527acdedfda54.zip
[locationinfo] Improve font size scaling for calendar
Diffstat (limited to 'modules-available/locationinfo/templates/frontend-default.html')
-rwxr-xr-xmodules-available/locationinfo/templates/frontend-default.html15
1 files changed, 8 insertions, 7 deletions
diff --git a/modules-available/locationinfo/templates/frontend-default.html b/modules-available/locationinfo/templates/frontend-default.html
index 4147e4e2..38cb7b7c 100755
--- a/modules-available/locationinfo/templates/frontend-default.html
+++ b/modules-available/locationinfo/templates/frontend-default.html
@@ -980,10 +980,11 @@ optional:
var columnWidth = $cal.find(".wc-day-1").width();
if (room.config.scaledaysauto) {
- var result = ($cal.weekCalendar("option", "daysToShow") * columnWidth) / 100;
+ var result = ($cal.weekCalendar("option", "daysToShow") * columnWidth) / 130;
result = parseInt(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();
}
}
if (((!room.config.scaledaysauto) || $cal.weekCalendar("option", "daysToShow") === 1) && columnWidth < 85) {
@@ -1007,21 +1008,21 @@ optional:
clientHeight -= 6;
var height = clientHeight / (room.openTimes * $cal.weekCalendar("option", "timeslotsPerHour"));
-
if (height < 30) {
height = 30;
}
+ var fontHeight = Math.min(height, columnWidth / 2.1);
// Scale calendar font
- if (height > 120) {
+ if (fontHeight > 120) {
$cal.weekCalendar("option", "textSize", 28);
}
- else if (height > 100) {
+ else if (fontHeight > 100) {
$cal.weekCalendar("option", "textSize", 24);
- } else if (height > 80) {
+ } else if (fontHeight > 80) {
$cal.weekCalendar("option", "textSize", 22);
- } else if (height > 70) {
+ } else if (fontHeight > 70) {
$cal.weekCalendar("option", "textSize", 20);
- } else if (height > 60) {
+ } else if (fontHeight > 60) {
$cal.weekCalendar("option", "textSize", 14);
} else {
$cal.weekCalendar("option", "textSize", 13);