add "mark read" floating button mobile. Fixes #469 (#505)

Signed-off-by: nachoparker <nacho@ownyourbits.com>
This commit is contained in:
nachoparker 2019-05-11 08:08:14 +00:00 committed by Benjamin Brahmer
parent bd43d0f3b1
commit 1a54c2abec
5 changed files with 29 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -11,6 +11,9 @@
width: 100%;
}
#mark-all-read-button {
display: block;
}
}
@media only screen and (max-width: 600px) {

View File

@ -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);

View File

@ -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(),

View File

@ -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() |