SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit ce743749 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Switch flowDirection when (un)focusing messages list

parent 8e435569
No related branches found
No related tags found
No related merge requests found
...@@ -95,14 +95,13 @@ ...@@ -95,14 +95,13 @@
</table> </table>
</div> </div>
<div class="accounts-table text-white"> <div class="accounts-table">
<h1 class="p-2 mb-0 text-center">Your email accounts</h1> <h1 class="p-2 mb-0 text-center">Your email accounts</h1>
<div class="text-center mb-1"><em>(click on a row to see messages)</em></div> <div class="text-center mb-1"><em>(click on a row to see messages)</em></div>
<table <table
class="table mb-4 text-white" class="table mb-4"
selectable selectable
:select-mode="single" :select-mode="single"
:selected-variant="danger"
> >
<tr> <tr>
<th>Account</th> <th>Account</th>
...@@ -291,9 +290,9 @@ ...@@ -291,9 +290,9 @@
</b-row> </b-row>
</b-card> </b-card>
<div v-if="threadOf" class="m-2"> <div v-if="threadOf" class="m-2">
<b-button size="sm" variant="info"><strong>Focusing on thread {{ threadOf }}</strong></b-button> <b-button size="sm" variant="info"><strong>Focusing on thread</strong></b-button>
<b-button size="sm" variant="warning" @click="threadOf = null"> <b-button size="sm" variant="warning" @click="threadOf = null">
Unfocus this thread Unfocus
</b-button> </b-button>
</div> </div>
<b-table <b-table
...@@ -388,12 +387,12 @@ ...@@ -388,12 +387,12 @@
<br> <br>
</template> </template>
<div v-if="threadOf != message.uuid"> <div v-if="threadOf != message.uuid">
<b-button class="m-2" variant="primary" @click="threadOf = message.uuid"> <b-button class="m-2" size="sm" variant="primary" @click="threadOf = message.uuid">
Focus on this thread Focus on this thread
</b-button> </b-button>
</div> </div>
<div v-else> <div v-else>
<b-button class="m-2" variant="warning" @click="threadOf = null"> <b-button class="m-2" size="sm" variant="warning" @click="threadOf = null">
Unfocus this thread Unfocus this thread
</b-button> </b-button>
</div> </div>
...@@ -470,6 +469,7 @@ export default { ...@@ -470,6 +469,7 @@ export default {
{ text: 'all', value: null }, { text: 'all', value: null },
], ],
flowDirection: 'in', flowDirection: 'in',
flowDirectionLastNotNull: 'in',
flowDirectionOptions: [ flowDirectionOptions: [
{ text: 'in', value: 'in' }, { text: 'in', value: 'in' },
{ text: 'out', value: 'out' }, { text: 'out', value: 'out' },
...@@ -627,6 +627,13 @@ export default { ...@@ -627,6 +627,13 @@ export default {
this.$root.$emit('bv::refresh::table', 'my-table') this.$root.$emit('bv::refresh::table', 'my-table')
}, },
threadOf: function () { threadOf: function () {
if (this.threadOf == null) {
this.flowDirection = this.flowDirectionLastNotNull
}
else {
this.flowDirectionLastNotNull = this.flowDirection
this.flowDirection = null
}
this.$root.$emit('bv::refresh::table', 'my-table') this.$root.$emit('bv::refresh::table', 'my-table')
}, },
timePeriod: function () { timePeriod: function () {
...@@ -639,6 +646,9 @@ export default { ...@@ -639,6 +646,9 @@ export default {
this.$root.$emit('bv::refresh::table', 'my-table') this.$root.$emit('bv::refresh::table', 'my-table')
}, },
flowDirection: function () { flowDirection: function () {
if (this.flowDirection != null) {
this.flowDirectionLastNotNull = this.flowDirection
}
this.$root.$emit('bv::refresh::table', 'my-table') this.$root.$emit('bv::refresh::table', 'my-table')
}, },
tagRequired: function () { tagRequired: function () {
...@@ -658,9 +668,10 @@ export default { ...@@ -658,9 +668,10 @@ export default {
<style> <style>
.accounts-table { .accounts-table {
background-color: #002b49; background-color: #d3e3f6;
} }
.highlight { .highlight {
background-color: #496bb6; background-color: #496bb6;
color: white;
} }
</style> </style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment