Skip to content

Commit

Permalink
only add tooltip lib if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kozi committed Aug 26, 2020
1 parent 2d1ab10 commit 266d69b
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/ContaoFullcalendar/Modules/ModuleFullCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,31 +90,32 @@ protected function compile()
$GLOBALS["TL_JAVASCRIPT"][] = "system/modules/fullcalendar/assets/fullcalendar/locales-all.min.js|static";
$GLOBALS['TL_CSS'][] = "system/modules/fullcalendar/assets/fullcalendar/main.min.css|static";

$GLOBALS["TL_JAVASCRIPT"][] = "system/modules/fullcalendar/assets/popper/popper.min.js|static";
$GLOBALS["TL_JAVASCRIPT"][] = "system/modules/fullcalendar/assets/tippy/tippy-bundle.umd.min.js|static";

$GLOBALS["TL_JAVASCRIPT"][] = "system/modules/fullcalendar/assets/fullcal.js|static";

$GLOBALS['TL_CSS'][] = "system/modules/fullcalendar/assets/tippy/themes/light-border.css|static";
$GLOBALS['TL_CSS'][] = "system/modules/fullcalendar/assets/tippy/themes/light.css|static";
$GLOBALS['TL_CSS'][] = "system/modules/fullcalendar/assets/tippy/themes/material.css|static";
$GLOBALS['TL_CSS'][] = "system/modules/fullcalendar/assets/tippy/themes/translucent.css|static";

if ($this->fullcal_wrapTitleMonth === "1") {
$this->Template->appendStyle = join("\n", [
".fc-daygrid-event { display:block; white-space:normal; }",
".fc-daygrid-event > div { display:inline-block; }",
]);
}

if (isset($this->fullcal_tooltip_options) && !ctype_space($this->fullcal_tooltip_options)) {
$this->Template->fullcalTooltipOptions = trim($this->fullcal_tooltip_options);

$GLOBALS["TL_JAVASCRIPT"][] = "system/modules/fullcalendar/assets/popper/popper.min.js|static";
$GLOBALS["TL_JAVASCRIPT"][] = "system/modules/fullcalendar/assets/tippy/tippy-bundle.umd.min.js|static";

$GLOBALS['TL_CSS'][] = "system/modules/fullcalendar/assets/tippy/themes/light-border.css|static";
$GLOBALS['TL_CSS'][] = "system/modules/fullcalendar/assets/tippy/themes/light.css|static";
$GLOBALS['TL_CSS'][] = "system/modules/fullcalendar/assets/tippy/themes/material.css|static";
$GLOBALS['TL_CSS'][] = "system/modules/fullcalendar/assets/tippy/themes/translucent.css|static";

}

if (isset($this->fullcal_options_additional) && !ctype_space($this->fullcal_options_additional)) {
$this->Template->fullcalOptionsAdditional = trim($this->fullcal_options_additional);
}

if ($this->fullcal_wrapTitleMonth === "1") {
$this->Template->appendStyle = join("\n", [
".fc-daygrid-event { display:block; white-space:normal; }",
".fc-daygrid-event > div { display:inline-block; }",
]);
}

$this->Template->showMenu = true;
$this->Template->jsonEventSources = json_encode($this->getEventSources($arrCalendarIds), JSON_NUMERIC_CHECK);
$this->Template->fullcalOptions = json_encode($fullcalOptions, JSON_NUMERIC_CHECK);
Expand Down

0 comments on commit 266d69b

Please sign in to comment.