mirror of
https://github.com/nasa/openmct.git
synced 2025-02-01 08:48:28 +00:00
Markup / scss refactor WIP
- Added view-control component
This commit is contained in:
parent
4c5baf183a
commit
f6b90caaff
44
src/ui/components/controls/viewControl.vue
Normal file
44
src/ui/components/controls/viewControl.vue
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<template>
|
||||||
|
<span class="c-view-control"
|
||||||
|
:class="{ 'c-view-control-expanded' : expanded }"></span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import "~styles/sass-base";;
|
||||||
|
|
||||||
|
.c-view-control {
|
||||||
|
$d: 14px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
height: $d;
|
||||||
|
width: $d;
|
||||||
|
margin-right: $interiorMargin;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: $glyph-icon-arrow-right-equilateral;
|
||||||
|
display: block;
|
||||||
|
font-family: symbolsfont;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
position: absolute;
|
||||||
|
transform-origin: center;
|
||||||
|
transition: transform 100ms ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-expanded {
|
||||||
|
&:before {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
expanded: Boolean
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<ul class="c-tree">
|
<ul class="c-tree">
|
||||||
<li class="c-tree__item-h">
|
<li class="c-tree__item-h">
|
||||||
<div class="c-tree__item" onclick="alert('tree item click');">
|
<div class="c-tree__item">
|
||||||
<span class="c-view-control"></span>
|
<viewControl></viewControl>
|
||||||
<span class="c-object-name icon-folder">
|
<span class="c-object-name icon-folder">
|
||||||
Tree item x with a long name that forces ellipsis to occur
|
Tree item x with a long name that forces ellipsis to occur
|
||||||
</span>
|
</span>
|
||||||
@ -19,7 +19,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "~styles/constants";
|
@import "~styles/sass-base";
|
||||||
|
|
||||||
.c-tree {
|
.c-tree {
|
||||||
.c-tree {
|
.c-tree {
|
||||||
@ -38,22 +38,15 @@
|
|||||||
&:hover {
|
&:hover {
|
||||||
background: rgba(white, 0.2);
|
background: rgba(white, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.c-view-control {
|
|
||||||
// TODO: move this into a future view-control component or the _controls.scss file
|
|
||||||
$d: 11px;
|
|
||||||
background: rgba(red, 0.4);
|
|
||||||
display: inline-block;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
height: $d;
|
|
||||||
width: $d;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import viewControl from '../controls/viewControl.vue'
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
viewControl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user