Преглед на файлове

Corrige bug chargement JS

Lorsque la vue par défaut était le mode lecture, le JS ne se chargeait
pas. La faute au script LazyLoad qui n'était pas chargé correctement
Marien Fressinaud преди 12 години
родител
ревизия
88668c7a9a
променени са 2 файла, в които са добавени 9 реда и са изтрити 6 реда
  1. 9 1
      app/App_FrontController.php
  2. 0 5
      app/controllers/indexController.php

+ 9 - 1
app/App_FrontController.php

@@ -47,6 +47,12 @@ class App_FrontController extends FrontController {
 		View::_param ('nb_not_read', $entryDAO->countNotRead ());
 
 		Session::_param ('language', $this->conf->language ());
+
+		$output = Request::param ('output');
+		if(!$output) {
+			$output = $this->conf->viewMode();
+			Request::_param ('output', $output);
+		}
 	}
 
 	private function loadStylesAndScripts () {
@@ -57,11 +63,13 @@ class App_FrontController extends FrontController {
 			}
 		}
 		View::appendStyle (Url::display ('/themes/printer/style.css?' . @filemtime(PUBLIC_PATH . '/themes/printer/style.css')), 'print');
+
 		if (login_is_conf ($this->conf)) {
 			View::appendScript ('https://login.persona.org/include.js');
 		}
 		View::appendScript (Url::display ('/scripts/jquery.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.min.js')));
-		if ($this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader')) {
+		if ($this->conf->lazyload () === 'yes' &&
+				($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader')) {
 			View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.lazyload.min.js')));
 		}
 		View::appendScript (Url::display ('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js')));

+ 0 - 5
app/controllers/indexController.php

@@ -44,11 +44,6 @@ class indexController extends ActionController {
 			$this->view->_useLayout (false);
 			header('Content-Type: application/rss+xml; charset=utf-8');
 		} else {
-			if(!$output) {
-				$output = $this->view->conf->viewMode();
-				Request::_param ('output', $output);
-			}
-
 			View::appendScript (Url::display ('/scripts/shortcut.js?' . @filemtime(PUBLIC_PATH . '/scripts/shortcut.js')));
 
 			if ($output == 'global') {