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