|
35 | 35 | <span class="label inspected" v-if="inspectedIndex === -1">inspected</span>
|
36 | 36 | </div>
|
37 | 37 | <div class="entry"
|
38 |
| - v-for="(entry, index) in filteredHistory" |
39 |
| - :class="{ inspected: inspectedIndex === index, active: activeIndex === index }" |
40 |
| - @click="step(index)"> |
| 38 | + v-for="entry in filteredHistory" |
| 39 | + :class="{ inspected: isInspected(entry), active: isActive(entry) }" |
| 40 | + @click="step(entry)"> |
41 | 41 | <span class="mutation-type">{{ entry.mutation.type }}</span>
|
42 |
| - <span class="entry-actions" v-if="inspectedIndex === index"> |
| 42 | + <span class="entry-actions" v-if="isInspected(entry)"> |
43 | 43 | <a class="action" @click.stop="commitSelected" title="Commit This Mutation">
|
44 | 44 | <i class="material-icons">get_app</i>
|
45 | 45 | <span>Commit</span>
|
|
48 | 48 | <i class="material-icons">delete</i>
|
49 | 49 | <span>Revert</span>
|
50 | 50 | </a>
|
51 |
| - <a v-if="activeIndex !== index" class="action" @click.stop="timeTravelToSelected" title="Time Travel to This State"> |
| 51 | + <a v-if="!isActive(entry)" class="action" @click.stop="timeTravelToSelected" title="Time Travel to This State"> |
52 | 52 | <i class="material-icons">restore</i>
|
53 | 53 | <span>Time Travel</span>
|
54 | 54 | </a>
|
55 | 55 | </span>
|
56 | 56 | <span class="time" :title="entry.timestamp">
|
57 | 57 | {{ entry.timestamp | formatTime }}
|
58 | 58 | </span>
|
59 |
| - <span class="label active" v-if="activeIndex === index">active</span> |
60 |
| - <span class="label inspected" v-if="inspectedIndex === index">inspected</span> |
| 59 | + <span class="label active" v-if="isActive(entry)">active</span> |
| 60 | + <span class="label inspected" v-if="isInspected(entry)">inspected</span> |
61 | 61 | </div>
|
62 | 62 | </div>
|
63 | 63 | </scroll-pane>
|
@@ -129,6 +129,12 @@ export default {
|
129 | 129 | 'step',
|
130 | 130 | 'timeTravelToSelected'
|
131 | 131 | ]),
|
| 132 | + isActive (entry) { |
| 133 | + return this.activeIndex === this.history.indexOf(entry) |
| 134 | + }, |
| 135 | + isInspected (entry) { |
| 136 | + return this.inspectedIndex === this.history.indexOf(entry) |
| 137 | + }, |
132 | 138 | onKeyNav (dir) {
|
133 | 139 | if (dir === 'up') {
|
134 | 140 | this.step(this.inspectedIndex - 1)
|
|
0 commit comments