Removed global Javascript variables
This commit is contained in:
parent
b97726f6ff
commit
f78d09b424
3 changed files with 11 additions and 9 deletions
|
@ -27,7 +27,7 @@ function getCookie(name)
|
||||||
|
|
||||||
function rememberLastSearchQuery()
|
function rememberLastSearchQuery()
|
||||||
{
|
{
|
||||||
//lastSearchQuery variable is obtained from layout
|
var lastSearchQuery = $('#settings').attr('data-last-search-query');
|
||||||
setCookie('last-search-query', lastSearchQuery);
|
setCookie('last-search-query', lastSearchQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@ function toggleTagEventHandler(e)
|
||||||
|
|
||||||
function alignPosts()
|
function alignPosts()
|
||||||
{
|
{
|
||||||
|
var thumbnailWidth = $('#settings').attr('data-thumbnail-width');
|
||||||
|
var thumbnailHeight = $('#settings').attr('data-thumbnail-width');
|
||||||
var samplePost = $('.posts .post:last-child');
|
var samplePost = $('.posts .post:last-child');
|
||||||
var container = $('.posts');
|
var container = $('.posts');
|
||||||
samplePost.find('.thumb').css('width', thumbnailWidth + 'px');
|
samplePost.find('.thumb').css('width', thumbnailWidth + 'px');
|
||||||
|
|
|
@ -11,6 +11,9 @@ if (!empty(Core::getConfig()->appearance->extraScripts))
|
||||||
if (!empty(Core::getConfig()->appearance->extraStylesheets))
|
if (!empty(Core::getConfig()->appearance->extraStylesheets))
|
||||||
foreach (Core::getConfig()->appearance->extraStylesheets as $path)
|
foreach (Core::getConfig()->appearance->extraStylesheets as $path)
|
||||||
$this->assets->addStylesheetFullPath($path);
|
$this->assets->addStylesheetFullPath($path);
|
||||||
|
$lastSearchQuery = isset($this->context->transport->lastSearchQuery)
|
||||||
|
? $this->context->transport->lastSearchQuery
|
||||||
|
: '';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
@ -26,14 +29,11 @@ if (!empty(Core::getConfig()->appearance->extraStylesheets))
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<script type="text/javascript">
|
<div id="settings"
|
||||||
var lastSearchQuery = <?= json_encode(
|
data-last-search-query="<?= htmlspecialchars($lastSearchQuery) ?>"
|
||||||
isset($this->context->transport->lastSearchQuery)
|
data-thumbnail-width="<?= Core::getConfig()->browsing->thumbnailWidth ?>"
|
||||||
? $this->context->transport->lastSearchQuery
|
data-thumbnail-height="<?= Core::getConfig()->browsing->thumbnailHeight ?>">
|
||||||
:'') ?>;
|
</div>
|
||||||
var thumbnailWidth = <?= Core::getConfig()->browsing->thumbnailWidth ?>;
|
|
||||||
var thumbnailHeight = <?= Core::getConfig()->browsing->thumbnailHeight ?>;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<nav id="top-nav">
|
<nav id="top-nav">
|
||||||
<div class="main-wrapper">
|
<div class="main-wrapper">
|
||||||
|
|
Loading…
Reference in a new issue