|
1 | 1 | <template>
|
2 |
| - <div id="tabsBar" class="noSelect pointerCursor"> |
| 2 | + <div id="tabsBar" class="noSelect pointerCursor" :class="embedClass()"> |
3 | 3 | <draggable
|
4 | 4 | :key="updateCount"
|
5 | 5 | v-model="SimulatorState.circuit_list"
|
|
20 | 20 | :key="element.id"
|
21 | 21 | style=""
|
22 | 22 | class="circuits toolbarButton"
|
23 |
| - :class="element.focussed ? 'current' : ''" |
| 23 | + :class="tabsbarClasses(element)" |
24 | 24 | draggable="true"
|
25 | 25 | @click="switchCircuit(element.id)"
|
26 | 26 | >
|
27 | 27 | <span class="circuitName noSelect">
|
28 | 28 | {{ truncateString(element.name, 18) }}
|
29 | 29 | </span>
|
30 | 30 | <span
|
| 31 | + v-if="!isEmbed()" |
31 | 32 | :id="element.id"
|
32 | 33 | class="tabsCloseButton"
|
33 | 34 | @click.stop="closeCircuit(element)"
|
|
37 | 38 | </div>
|
38 | 39 | </template>
|
39 | 40 | </draggable>
|
40 |
| - <button @click="createNewCircuitScope()">+</button> |
| 41 | + <button v-if="!isEmbed()" @click="createNewCircuitScope()"> |
| 42 | + + |
| 43 | + </button> |
41 | 44 | </div>
|
42 | 45 | <!-- <MessageBox
|
43 | 46 | v-model="SimulatorState.dialogBox.create_circuit"
|
@@ -243,20 +246,61 @@ function dragOptions(): Object {
|
243 | 246 | }
|
244 | 247 | }
|
245 | 248 |
|
246 |
| -// TODO: fix class adding for embed @Arnabdaz |
247 |
| -function tabsbarClasses(id: number | string): string { |
| 249 | +function tabsbarClasses(e: any): string { |
248 | 250 | let class_list = ''
|
249 | 251 | if ((window as any).embed) {
|
250 | 252 | class_list = 'embed-tabs'
|
251 | 253 | }
|
252 |
| - if ((window as any).globalScope.id == id) { |
| 254 | + if (e.focussed) { |
253 | 255 | class_list += ' current'
|
254 | 256 | }
|
255 | 257 | return class_list
|
256 | 258 | }
|
| 259 | +
|
| 260 | +function embedClass(): string { |
| 261 | + if ((window as any).embed) { |
| 262 | + return 'embed-tabbar' |
| 263 | + } |
| 264 | + return '' |
| 265 | +} |
| 266 | +
|
| 267 | +function isEmbed(): boolean { |
| 268 | + return (window as any).embed |
| 269 | +} |
257 | 270 | </script>
|
258 | 271 |
|
259 | 272 | <style scoped>
|
| 273 | +#tabsBar.embed-tabbar { |
| 274 | + background-color: transparent; |
| 275 | +} |
| 276 | +
|
| 277 | +#tabsBar.embed-tabbar .circuits { |
| 278 | + border: 1px solid var(--br-circuit); |
| 279 | + color: var(--text-circuit); |
| 280 | + background-color: var(--bg-tabs) !important; |
| 281 | +} |
| 282 | +
|
| 283 | +#tabsBar.embed-tabbar .circuits:hover { |
| 284 | + background-color: var(--bg-circuit) !important; |
| 285 | +} |
| 286 | +
|
| 287 | +#tabsBar.embed-tabbar .current { |
| 288 | + color: var(--text-circuit); |
| 289 | + background-color: var(--bg-circuit) !important; |
| 290 | + /* border: 1px solid var(--br-circuit-cur); */ |
| 291 | +} |
| 292 | +
|
| 293 | +#tabsBar.embed-tabbar button { |
| 294 | + color: var(--text-panel); |
| 295 | + background-color: var(--primary); |
| 296 | + border: 1px solid var(--br-circuit-cur); |
| 297 | +} |
| 298 | +
|
| 299 | +#tabsBar.embed-tabbar button:hover { |
| 300 | + color: var(--text-panel); |
| 301 | + border: 1px solid var(--br-circuit-cur); |
| 302 | +} |
| 303 | +
|
260 | 304 | .list-group {
|
261 | 305 | display: inline;
|
262 | 306 | }
|
|
0 commit comments