Skip to content

Commit

Permalink
allow creation of new post while feed is refreshed
Browse files Browse the repository at this point in the history
  • Loading branch information
kevodwyer committed Nov 22, 2024
1 parent 860f46a commit cb1b800
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/social/SocialPost.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<transition name="modal" appear>
<div class="social-post post-modal__overlay" @click="close()" v-bind:style="{top:modelTop}" style="position: absolute;">
<div class="social-post post-modal__overlay" @click="close()" v-bind:style="{top:modelTop}" style="position: absolute;z-index: 2000000001;">

<Spinner v-if="showSpinner"></Spinner>
<div class="social-post__container" @click.stop>
Expand Down
30 changes: 21 additions & 9 deletions src/views/NewsFeed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
<h1>{{ translate("NEWSFEED.TITLE") }}</h1>
</template>
<template #tools>
<AppButton
aria-label="New Post"
@click.native="addNewPost()"
size="small"
accent
>
{{ translate("NEWSFEED.NEW") }}
</AppButton>
<div style="z-index: 2000000001">
<AppButton
aria-label="New Post"
@click.native="addNewPost()"
size="small"
accent
>
{{ translate("NEWSFEED.NEW") }}
</AppButton>
</div>
<button :disabled="showSpinner" class="refresh-btn btn-success" @click="refresh()" aria-label="Refresh">
<i v-if="showSpinner" aria-hidden="true">
<svg class="refresh-icon imageRotate" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1639 1056q0 5-1 7-64 268-268 434.5t-478 166.5q-146 0-282.5-55t-243.5-157l-129 129q-19 19-45 19t-45-19-19-45v-448q0-26 19-45t45-19h448q26 0 45 19t19 45-19 45l-137 137q71 66 161 102t187 36q134 0 250-65t186-179q11-17 53-117 8-23 30-23h192q13 0 22.5 9.5t9.5 22.5zm25-800v448q0 26-19 45t-45 19h-448q-26 0-45-19t-19-45 19-45l138-138q-148-137-349-137-134 0-250 65t-186 179q-11 17-53 117-8 23-30 23h-199q-13 0-22.5-9.5t-9.5-22.5v-7q65-268 270-434.5t480-166.5q146 0 284 55.5t245 156.5l130-129q19-19 45-19t45 19 19 45z" fill="#fff"/></svg>
Expand Down Expand Up @@ -480,10 +482,20 @@ module.exports = {
}
} else {
if (newSocialPost != null) {
this.refresh();
this.refreshWhenAvailable();
}
}
},
refreshWhenAvailable: function() {
let that = this;
if (this.showSpinner) {
setTimeout(function () {
that.refreshWhenAvailable();
}, 200);
} else {
this.refresh();
}
},
getPosition: function(e) {
var posx = 0;
var posy = 0;
Expand Down

0 comments on commit cb1b800

Please sign in to comment.