-
Notifications
You must be signed in to change notification settings - Fork 471
/
Copy pathFileTitle.vue
executable file
·71 lines (67 loc) · 1.4 KB
/
FileTitle.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<template>
<div>
<i
v-show="previousimage != null"
class="fa fa-arrow-left image-arrows"
style="float:left"
@click="route(previousimage, labelmode)"
/>
<i
v-show="nextimage != null"
class="fa fa-arrow-right image-arrows"
style="float:right"
@click="route(nextimage, labelmode)"
/>
<h6 class="text-center" style="color: white;">
<span class="d-inline-block text-truncate" style="max-width: 73%;">{{
filename
}}</span>
</h6>
</div>
</template>
<script>
export default {
name: "FileTitle",
props: {
filename: {
type: String,
required: true
},
previousimage: {
type: Number,
default: null
},
nextimage: {
type: Number,
default: null
},
labelmode: {
type: String,
required: false
}
},
methods: {
/**
* Navigates to image with provided ID
*
* @param {Number} identifer id of a file
*/
route(identifier, labelmode) {
// Make sure we pop the latest session before annotations
this.$parent.current.annotation = -1;
this.$nextTick(() => {
this.$parent.save(() => {
this.$router.push({ name: "annotate", params: { identifier, labelmode } });
});
});
}
}
};
</script>
<style scoped>
.image-arrows {
color: white;
position: relative;
margin: 0 10px 15px 10px;
}
</style>