Skip to content

Commit

Permalink
Update AccountImport, add select first 100 posts button
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Jul 2, 2023
1 parent 2d959fb commit 625a76a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions resources/assets/components/AccountImport.vue
Expand Up @@ -105,6 +105,9 @@
<p class="small text-muted mb-0">Tap on posts to include them in your import.</p>
</div>
<p v-else class="lead mb-0"><span class="font-weight-bold">{{ selectedPostsCounter }}</span> posts selected for import</p>

<button v-if="selectedMedia.length" class="btn btn-outline-danger font-weight-bold rounded-pill btn-sm my-1" @click="handleClearAll()">Clear all selected</button>
<button v-else class="btn btn-outline-primary font-weight-bold rounded-pill" @click="handleSelectAll()">Select first 100 posts</button>
</div>
</section>
<section class="row mb-n5 media-selector" style="max-height: 600px;overflow-y: auto;">
Expand Down Expand Up @@ -590,6 +593,19 @@
window.location.href = '/site/contact'
}
});
},
handleSelectAll() {
let medias = this.postMeta.slice(0, 100);
for (var i = medias.length - 1; i >= 0; i--) {
let m = medias[i];
this.toggleSelectedPost(m);
}
},
handleClearAll() {
this.selectedMedia = []
this.selectedPostsCounter = 0;
}
}
}
Expand Down

0 comments on commit 625a76a

Please sign in to comment.