summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2019-05-11 08:08:14 +0000
committerBenjamin Brahmer <info@b-brahmer.de>2019-05-11 10:08:14 +0200
commit1a54c2abec7e05c60d7bf6eda7259b8e08a92dde (patch)
treec62ba676425290f129613bdd1db2a0b37aff8ffc
parentbd43d0f3b17c76bbe41f68f6d1cc5926da6b38fe (diff)
add "mark read" floating button mobile. Fixes #469 (#505)
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r--css/app.css9
-rw-r--r--css/mobile.css3
-rw-r--r--js/controller/NavigationController.js13
-rw-r--r--lib/Controller/FeedController.php2
-rw-r--r--templates/part.content.php4
5 files changed, 29 insertions, 2 deletions
diff --git a/css/app.css b/css/app.css
index ffaf63617..86a367e0d 100644
--- a/css/app.css
+++ b/css/app.css
@@ -44,7 +44,14 @@
display: block !important;
}
+#mark-all-read-button {
+ position: fixed;
+ z-index: 1;
+ bottom: 0.5em;
+ right: 0.5em;
+}
+
/* Override hidden before angular is loaded */
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {
display: none !important;
-} \ No newline at end of file
+}
diff --git a/css/mobile.css b/css/mobile.css
index cf34507fc..83e228b2f 100644
--- a/css/mobile.css
+++ b/css/mobile.css
@@ -11,6 +11,9 @@
width: 100%;
}
+ #mark-all-read-button {
+ display: block;
+ }
}
@media only screen and (max-width: 600px) {
diff --git a/js/controller/NavigationController.js b/js/controller/NavigationController.js
index e79202574..e4306c9a8 100644
--- a/js/controller/NavigationController.js
+++ b/js/controller/NavigationController.js
@@ -36,6 +36,19 @@ app.controller('NavigationController', function ($route, FEED_TYPE, FeedResource
return FolderResource.getAll();
};
+ this.markCurrentRead = function () {
+ var id = getRouteId();
+ var type = $route.current.$$route.type;
+
+ if(isNaN(id)) {
+ this.markRead();
+ } else if(type === FEED_TYPE.FOLDER) {
+ this.markFolderRead(id);
+ } else if(type === FEED_TYPE.FEED) {
+ this.markFeedRead(id);
+ }
+ };
+
this.markFolderRead = function (folderId) {
FeedResource.markFolderRead(folderId);
diff --git a/lib/Controller/FeedController.php b/lib/Controller/FeedController.php
index dbb36bb02..32e9bd232 100644
--- a/lib/Controller/FeedController.php
+++ b/lib/Controller/FeedController.php
@@ -207,7 +207,7 @@ class FeedController extends Controller
return [
'feeds' => [
- // only pass unread count to not accidentally readd
+ // only pass unread count to not accidentally read
// the feed again
[
'id' => $feed->getId(),
diff --git a/templates/part.content.php b/templates/part.content.php
index c240053ca..6b57af338 100644
--- a/templates/part.content.php
+++ b/templates/part.content.php
@@ -12,6 +12,10 @@
<p ng-show="Content.isShowAll()"><?php p($l->t('No articles available')) ?></p>
<p ng-show="!Content.isShowAll()"><?php p($l->t('No unread articles available')) ?></p>
</div>
+ <button ng-controller="NavigationController as Navigation" id="mark-all-read-button" ng-click="Navigation.markCurrentRead()" class="hidden">
+ <span title="Mark Read" class="icon-checkmark"></span>
+ </button>
+
<ul>
<li class="item {{ ::Content.getFeed(item.feedId).cssClass }}"
ng-repeat="item in Content.getItems() |