Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
3 changes: 3 additions & 0 deletions css/mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
width: 100%;
}

#mark-all-read-button {
display: block;
}
}

@media only screen and (max-width: 600px) {
Expand Down
13 changes: 13 additions & 0 deletions js/controller/NavigationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/FeedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function update($feedId)

return [
'feeds' => [
// only pass unread count to not accidentally readd
// only pass unread count to not accidentally read
// the feed again
[
'id' => $feed->getId(),
Expand Down
4 changes: 4 additions & 0 deletions templates/part.content.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class="app-content-detail">
<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() |
Expand Down