mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 13:03:16 +00:00
Merge pull request #1278 from pixelfed/frontend-ui-refactor
Frontend ui refactor
This commit is contained in:
commit
92dc035e42
5 changed files with 22 additions and 7 deletions
BIN
public/js/profile.js
vendored
BIN
public/js/profile.js
vendored
Binary file not shown.
BIN
public/js/timeline.js
vendored
BIN
public/js/timeline.js
vendored
Binary file not shown.
Binary file not shown.
|
@ -516,6 +516,7 @@ export default {
|
|||
],
|
||||
data() {
|
||||
return {
|
||||
ids: [],
|
||||
profile: {},
|
||||
user: {},
|
||||
timeline: [],
|
||||
|
@ -568,6 +569,7 @@ export default {
|
|||
.then(res => {
|
||||
let data = res.data;
|
||||
let ids = data.map(status => status.id);
|
||||
this.ids = ids;
|
||||
this.min_id = Math.max(...ids);
|
||||
this.max_id = Math.min(...ids);
|
||||
this.modalStatus = _.first(res.data);
|
||||
|
@ -601,9 +603,15 @@ export default {
|
|||
}).then(res => {
|
||||
if (res.data.length && this.loading == false) {
|
||||
let data = res.data;
|
||||
let ids = data.map(status => status.id);
|
||||
this.max_id = Math.min(...ids);
|
||||
this.timeline.push(...data);
|
||||
let self = this;
|
||||
data.forEach(d => {
|
||||
if(self.ids.indexOf(d.id) == -1) {
|
||||
self.timeline.push(d);
|
||||
self.ids.push(d.id);
|
||||
}
|
||||
});
|
||||
this.min_id = Math.max(...this.ids);
|
||||
this.max_id = Math.min(...this.ids);
|
||||
$state.loaded();
|
||||
this.loading = false;
|
||||
} else {
|
||||
|
|
|
@ -430,6 +430,7 @@
|
|||
props: ['scope'],
|
||||
data() {
|
||||
return {
|
||||
ids: [],
|
||||
config: {},
|
||||
page: 2,
|
||||
feed: [],
|
||||
|
@ -544,6 +545,7 @@
|
|||
let data = res.data;
|
||||
this.feed.push(...data);
|
||||
let ids = data.map(status => status.id);
|
||||
this.ids = ids;
|
||||
this.min_id = Math.max(...ids);
|
||||
this.max_id = Math.min(...ids);
|
||||
$('.timeline .pagination').removeClass('d-none');
|
||||
|
@ -579,10 +581,15 @@
|
|||
}).then(res => {
|
||||
if (res.data.length && this.loading == false) {
|
||||
let data = res.data;
|
||||
this.feed.push(...data);
|
||||
let ids = data.map(status => status.id);
|
||||
this.min_id = Math.max(...ids);
|
||||
this.max_id = Math.min(...ids);
|
||||
let self = this;
|
||||
data.forEach(d => {
|
||||
if(self.ids.indexOf(d.id) == -1) {
|
||||
self.feed.push(d);
|
||||
self.ids.push(d.id);
|
||||
}
|
||||
});
|
||||
this.min_id = Math.max(...this.ids);
|
||||
this.max_id = Math.min(...this.ids);
|
||||
this.page += 1;
|
||||
$state.loaded();
|
||||
this.loading = false;
|
||||
|
|
Loading…
Reference in a new issue