-
Notifications
You must be signed in to change notification settings - Fork 82
/
Tooltip.vue
154 lines (149 loc) · 3.83 KB
/
Tooltip.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<template>
<div class="icon-placement">
<v-btn
@click.stop.prevent="showDialog = true"
icon
small
class="align-start ml-n2"
aria-label="More Information"
>
<v-icon x-small allow-overflow :color="color" dark
>fas fa-info-circle</v-icon
>
<span class="sr-only">More Information</span>
</v-btn>
<v-dialog max-width="500px" v-model="showDialog">
<v-card>
<v-btn @click="showDialog = false" icon class="float-right mt-3 mr-3"
><v-icon>fas fa-times-circle</v-icon></v-btn
>
<v-card-title class="tool-tip-dialog-title">{{ title }}</v-card-title>
<v-card-text class="pb-5">
<div v-html="content"></div>
<!-- <p v-if="limitedFoS">
The data shown is for undergraduate fields of study (undergraduate
certificates, associate's degrees, and bachelor's degrees) for which
there is data. For more information on other credentials, including
Graduate-level degrees and certificates, see
<a :href="limitedFoS">All Fields of Study</a> for this school.
</p> -->
<p v-if="showBranch">
This information is based on all locations of this school.
</p>
<p v-if="showCompare">
For schools with multiple locations, this information is based on
all of their locations.
</p>
<div v-if="info" v-html="info"></div>
<p class="text-center mt-3" v-if="hasGlossary">
<v-btn
:href="$url('/data/glossary/#' + definition)"
small
rounded
color="secondary"
class="px-4"
target="_blank"
>More Information</v-btn
>
</p>
</v-card-text>
</v-card>
</v-dialog>
</div>
</template>
<style lang="scss" scoped>
.csTooltip {
font-size: 1rem;
}
.tool-tip-dialog-title {
word-break: normal;
word-wrap: break-word;
display: inline-block;
width: 450px;
}
.icon-placement {
width: 30px;
display: inline;
}
</style>
<script>
import { SiteData } from "~/js/mixins/SiteData.js"
export default {
mixins: [SiteData],
props: {
definition: String,
color: {
type: String,
default: "blue darken-3",
},
version: {
type: String,
default: "default",
},
isBranch: {
type: Boolean,
default: false,
},
isCompare: {
type: Boolean,
default: false,
},
limitedFoS: {
type: String,
default: null,
},
showInfo: {
type: Boolean,
default: true,
},
isNegative: {
type: Boolean,
default: false,
},
isPell: {
type: Boolean,
default: false,
},
},
data() {
return {
showDialog: false,
}
},
computed: {
glossary() {
return this.site.data.glossary
},
entry() {
return this.glossary[this.definition]
},
title() {
return this.entry["title"]
},
content() {
if (this.isNegative && this.entry["negative"])
return this.entry["negative"]
else if (this.isCompare && this.entry["compare"])
return this.entry["compare"]
else if (this.isGraduate && this.entry["graduate"])
return this.entry["graduate"]
else if (this.isPell && this.entry["pell"]) return this.entry["pell"]
else if (this.isPell) return this.entry[this.version + "-pell"]
else return this.entry[this.version]
},
info() {
return this.entry["info"] && this.showInfo ? this.entry["info"] : false
},
hasGlossary() {
return this.entry["glossary"] ? true : false
},
showBranch() {
return this.entry.branch && this.isBranch
},
showCompare() {
return this.entry.branch && this.isCompare
},
},
mounted() {},
}
</script>