Skip to content

A free, self-hostable news aggregator…

Do not render irrelevant HTML for Ajax calls (#4310)

Alexandre Alapetite0698c8a0b22a
diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml
index 1d41cc690..e0519960e 100644
--- a/app/layout/layout.phtml
+++ b/app/layout/layout.phtml
@@ -47,8 +47,10 @@ if (_t('gen.dir') === 'rtl') {
</head>
<body class="<?= Minz_Request::actionName() ?>">
<?php
- flush();
- $this->partial('header');
+ if (!Minz_Request::param('ajax')) {
+ flush();
+ $this->partial('header');
+ }
?>
<div id="global">
diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml
index 49e3c791a..555582c5f 100644
--- a/app/views/index/normal.phtml
+++ b/app/views/index/normal.phtml
@@ -1,7 +1,9 @@
<?php
/** @var FreshRSS_View $this */
-$this->partial('aside_feed');
-$this->partial('nav_menu');
+if (!Minz_Request::param('ajax')) {
+ $this->partial('aside_feed');
+ $this->partial('nav_menu');
+}
call_user_func($this->callbackBeforeEntries, $this);
diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml
index b408e3480..3bd644367 100644
--- a/app/views/index/reader.phtml
+++ b/app/views/index/reader.phtml
@@ -1,7 +1,9 @@
-<?php /** @var FreshRSS_View $this */ ?>
<?php
-$this->partial('aside_feed');
-$this->partial('nav_menu');
+/** @var FreshRSS_View $this */
+if (!Minz_Request::param('ajax')) {
+ $this->partial('aside_feed');
+ $this->partial('nav_menu');
+}
call_user_func($this->callbackBeforeEntries, $this);