From f78d09b424c61dc61ad316db8429651b691fb4bc Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 8 Aug 2014 20:00:55 +0200 Subject: [PATCH] Removed global Javascript variables --- public_html/media/js/core.js | 2 +- public_html/media/js/post-list.js | 2 ++ src/Views/layout-normal.phtml | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/public_html/media/js/core.js b/public_html/media/js/core.js index 69fb9364..4518b525 100644 --- a/public_html/media/js/core.js +++ b/public_html/media/js/core.js @@ -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); } diff --git a/public_html/media/js/post-list.js b/public_html/media/js/post-list.js index f2cb5b59..582df9f1 100644 --- a/public_html/media/js/post-list.js +++ b/public_html/media/js/post-list.js @@ -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'); diff --git a/src/Views/layout-normal.phtml b/src/Views/layout-normal.phtml index e8f73659..8bd675fd 100644 --- a/src/Views/layout-normal.phtml +++ b/src/Views/layout-normal.phtml @@ -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 + : ''; ?> @@ -26,14 +29,11 @@ if (!empty(Core::getConfig()->appearance->extraStylesheets)) - +
+