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

Mobile layout navigation #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
<span class="icon">{% inline "x.svg" %}</span>
</button>
</div>
<div v-if="itemSelectedDetails" ref="content" class="content px-4 pt-3 pb-5 border-top overflow-auto"
<div v-if="itemSelectedDetails" ref="content" class="d-flex justify-content-center align-items-start content px-4 pt-3 pb-5 border-top overflow-auto"
:class="{'font-serif': theme.font == 'serif', 'font-monospace': theme.font == 'monospace'}"
:style="{'font-size': theme.size + 'rem'}">
<div class="content-wrapper">
Expand Down
9 changes: 9 additions & 0 deletions src/assets/javascripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ Vue.component('relative-time', {

var vm = new Vue({
created: function() {
window.addEventListener('popstate', (event)=>{
if(!this.itemSelected)
this.feedSelected = null;
else
this.itemSelected = null;
});
this.refreshStats()
.then(this.refreshFeeds.bind(this))
.then(this.refreshItems.bind(this, false))
Expand Down Expand Up @@ -312,12 +318,14 @@ var vm = new Vue({
this.computeStats()
},
'feedSelected': function(newVal, oldVal) {
window.history.pushState(null, null);
if (oldVal === undefined) return // do nothing, initial setup
api.settings.update({ feed: newVal }).then(this.refreshItems.bind(this, false))
this.itemSelected = null
if (this.$refs.itemlist) this.$refs.itemlist.scrollTop = 0
},
'itemSelected': function(newVal, oldVal) {
window.history.pushState(null, null);
this.itemSelectedReadability = ''
if (newVal === null) {
this.itemSelectedDetails = null
Expand Down Expand Up @@ -405,6 +413,7 @@ var vm = new Vue({
.then(function(values) {
vm.folders = values[0]
vm.feeds = values[1]
window.history.pushState(null, null);
})
},
refreshItems: function(loadMore) {
Expand Down
3 changes: 2 additions & 1 deletion src/assets/stylesheets/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ select.form-control:not([multiple]):not([size]) {

.content-wrapper {
max-width: 60rem;
margin: 0 auto;
margin-left: 3rem;
margin-right: 3rem;
}

.content img, .content video {
Expand Down