From a3a77b09e96f66eec4e31e638b58c785cfb369a3 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 22 Nov 2014 08:01:31 -0500 Subject: Add an automatic sticky post configuration Before, when the article while marked as read while scrolling and auto removed after reading, the display was in the middle of the following article. Now, the article is forced to be a sticky article so the user display is forced to be on top of the following article. --- app/Models/Context.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'app/Models/Context.php') diff --git a/app/Models/Context.php b/app/Models/Context.php index cbd6a5888..3dc5349ad 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -287,4 +287,22 @@ class FreshRSS_Context { } return true; } + + /** + * Determine if the "sticky post" option is enabled. It can be enable + * by the user when it is selected in the configuration page or by the + * application when the context allows to auto-remove articles when they + * are read. + * + * @return boolean + */ + public static function isStickyPostEnabled() { + if (self::$conf->sticky_post) { + return true; + } + if (self::isAutoRemoveAvailable()) { + return true; + } + return false; + } } -- cgit v1.2.3