Refinements to view control in tree

- Changed state eval to use 'enabled', removed v-if;
This commit is contained in:
charlesh88 2018-08-21 15:56:12 -07:00
parent 3a2439cd16
commit 2ee7a77a86
3 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<span class="c-view-control"
:class="{
'c-view-control--expanded' : expanded,
'is-disabled' : disabled === true
'is-enabled' : enabled
}"
@click="toggle"></span>
</template>
@ -19,8 +19,8 @@
width: $d;
position: relative;
&:not(.is-disabled):before {
$s: .75;
&.is-enabled:before {
$s: .65;
content: $glyph-icon-arrow-right-equilateral;
display: block;
font-family: symbolsfont;
@ -45,7 +45,7 @@
type: Boolean,
value: false
},
disabled: {
enabled: {
// Provided to allow the view-control to still occupy space without displaying a control icon.
// Used as such in the tree - when a node doesn't have children, set disabled to true.
type: Boolean,

View File

@ -16,7 +16,7 @@
height: 100%;
.c-tree {
margin-left: 20px;
margin-left: 15px;
}
&__item {

View File

@ -2,7 +2,7 @@
<li class="c-tree__item-h">
<div class="c-tree__item">
<view-control class="c-tree__item__view-control"
v-if="hasChildren"
:enabled="hasChildren"
:expanded="expanded"
@click="toggleChildren">
</view-control>