|
@ -5,17 +5,11 @@ |
|
|
if={this.swipe} |
|
|
if={this.swipe} |
|
|
class={`animated ${this.transition}`} |
|
|
class={`animated ${this.transition}`} |
|
|
> |
|
|
> |
|
|
<div if={this.nomore}> |
|
|
|
|
|
<h4>No more posts!</h4> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div if={!this.nomore}> |
|
|
|
|
|
<h4>{ this.title }</h4> |
|
|
<h4>{ this.title }</h4> |
|
|
<h5>Posted by { this.author }</h5> |
|
|
<h5>Posted by { this.author }</h5> |
|
|
<p class="post-content centered text-break"> |
|
|
<p class="post-content centered text-break"> |
|
|
{ this.content } |
|
|
{ this.content } |
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
|
|
|
<div class="divider"></div> |
|
|
<div class="divider"></div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -78,8 +72,7 @@ next(ev) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
setPost(pid, transition) { |
|
|
setPost(pid, transition) { |
|
|
this.opts.state.pid = pid; |
|
|
fetch(`/blog/switchpost/${pid-1}`) |
|
|
fetch(`/blog/switchpost/${this.opts.state.pid-1}`) |
|
|
|
|
|
.then((resp) => resp.text()) |
|
|
.then((resp) => resp.text()) |
|
|
.then( |
|
|
.then( |
|
|
(body) => { |
|
|
(body) => { |
|
@ -87,8 +80,6 @@ setPost(pid, transition) { |
|
|
self.nomore = true; |
|
|
self.nomore = true; |
|
|
self.prevloading = ""; |
|
|
self.prevloading = ""; |
|
|
self.nextloading = ""; |
|
|
self.nextloading = ""; |
|
|
self.swipe = true; |
|
|
|
|
|
self.transition = transition; |
|
|
|
|
|
self.update() |
|
|
self.update() |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -99,10 +90,12 @@ setPost(pid, transition) { |
|
|
self.nextloading = ""; |
|
|
self.nextloading = ""; |
|
|
self.nomore = true; |
|
|
self.nomore = true; |
|
|
self.swipe = true; |
|
|
self.swipe = true; |
|
|
self.transition = transition; |
|
|
self.transition = ""; |
|
|
|
|
|
self.opts.state.pid--; |
|
|
self.update(); |
|
|
self.update(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
self.opts.state.pid = pid; |
|
|
self.author = postcontent[0].doc.author[0]; |
|
|
self.author = postcontent[0].doc.author[0]; |
|
|
self.content = postcontent[0].doc.content[0]; |
|
|
self.content = postcontent[0].doc.content[0]; |
|
|
self.title = postcontent[0].doc.title[0]; |
|
|
self.title = postcontent[0].doc.title[0]; |
|
|