Skip to content

Commit

Permalink
Add module version to css file for prevent cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
UksusoFF committed Apr 24, 2018
1 parent f6e9013 commit 27001b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions module.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ public function getMenu()
global $controller;

if (Theme::theme()->themeId() !== '_administration') {
$cssPath = $this->path . '/_css/module.css?v=' . self::CUSTOM_VERSION;
$header = 'if (document.createStyleSheet) {
document.createStyleSheet("' . $this->path . '/_css/module.css"); // For Internet Explorer
document.createStyleSheet("' . $cssPath . '"); // For Internet Explorer
} else {
jQuery("head").append(\'<link rel="stylesheet" href="' . $this->path . '/_css/module.css" type="text/css">\');
jQuery("head").append(\'<link rel="stylesheet" href="' . $cssPath . '" type="text/css">\');
}';
$controller->addInlineJavascript($header, BaseController::JS_PRIORITY_LOW)
->addExternalJavascript('https://cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.3.5/mobile-detect.min.js')
Expand Down

0 comments on commit 27001b9

Please sign in to comment.