From 84c03dda5f8c938317ec6f049301d1acaa00d0de Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 29 Oct 2013 21:53:02 +0100 Subject: LazyLoad manuel pour les articles repliés MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LazyLoad.js utilise énormément de CPU et ralentit considérablement le défilement de page, en particulier lorsque le nombre d'articles augmente. Dans le cas des articles repliés, il n'y a en fait pas besoin du mécanisme complexe de LazyLoad.js basé sur les événements scroll, car il suffit de charger les images lors du dépliage es articles, et cela allège énormément l'expérience. --- app/App_FrontController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/App_FrontController.php') diff --git a/app/App_FrontController.php b/app/App_FrontController.php index 844956cf9..a9a0a564f 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -62,7 +62,7 @@ class App_FrontController extends FrontController { View::appendScript ('https://login.persona.org/include.js'); } View::appendScript (Url::display ('/scripts/jquery.min.js')); - if ($this->conf->lazyload () === 'yes') { + if ($this->conf->displayPosts () === 'yes' && $this->conf->lazyload () === 'yes') { View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js')); } View::appendScript (Url::display ('/scripts/notification.js')); -- cgit v1.2.3 From 1a209f1e9b791d5339d0968b55e78844281daf0e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 30 Oct 2013 11:06:38 +0100 Subject: Ajoute le cas de la vue lecture --- app/App_FrontController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/App_FrontController.php') diff --git a/app/App_FrontController.php b/app/App_FrontController.php index a9a0a564f..314e92ebc 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -62,7 +62,7 @@ class App_FrontController extends FrontController { View::appendScript ('https://login.persona.org/include.js'); } View::appendScript (Url::display ('/scripts/jquery.min.js')); - if ($this->conf->displayPosts () === 'yes' && $this->conf->lazyload () === 'yes') { + if ($this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader')) { View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js')); } View::appendScript (Url::display ('/scripts/notification.js')); -- cgit v1.2.3