[Navigation Tree] Move "nav up" arrow down one item (#3581)

* moved nav up arrow down one tree item and updated icon
* cleaned up css to be more targeted for up arrow

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
Co-authored-by: charlesh88 <charlesh88@gmail.com>
This commit is contained in:
Jamie V 2021-02-18 09:55:54 -08:00 committed by GitHub
parent 7623a0648f
commit 6226763c37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 5 deletions

View File

@ -57,6 +57,14 @@
overflow-x: hidden;
overflow-y: auto;
.icon-arrow-nav-to-parent {
visibility: hidden;
&.is-enabled {
visibility: visible;
}
}
li {
position: relative;
&[class*="__item-h"] {
@ -99,6 +107,14 @@
&.is-context-clicked {
box-shadow: inset $colorItemTreeSelectedBg 0 0 0 1px;
}
.icon-arrow-nav-to-parent {
visibility: hidden;
&.is-enabled {
visibility: visible;
}
}
}
}

View File

@ -65,7 +65,7 @@
v-for="(ancestor, index) in focusedAncestors"
:key="ancestor.id"
:node="ancestor"
:show-up="index < focusedAncestors.length - 1 && initialLoad"
:show-up="index !== 0 && index < focusedAncestors.length && initialLoad"
:show-down="false"
:left-offset="index * 10 + 'px'"
@resetTree="beginNavigationRequest('handleReset', ancestor)"
@ -406,13 +406,17 @@ export default {
this.childrenSlideClass = 'up';
let index = this.tempAncestors.indexOf(node);
this.tempAncestors = [...this.ancestors];
this.tempAncestors.splice(this.tempAncestors.indexOf(node) + 1);
this.tempAncestors.splice(index);
let parentNode = this.tempAncestors[index - 1];
let objectPath = this.ancestorsAsObjects();
objectPath.splice(objectPath.indexOf(node.object) + 1);
objectPath.splice(objectPath.indexOf(node.object));
let childrenItems = await this.getChildrenAsTreeItems(node, objectPath, requestId);
let childrenItems = await this.getChildrenAsTreeItems(parentNode, objectPath, requestId);
// if all is good, return true for successful navigation
return this.updateTree(this.tempAncestors, childrenItems, requestId);

View File

@ -20,7 +20,7 @@
ref="navUp"
v-model="expanded"
class="c-tree__item__view-control"
:control-class="'c-nav__up'"
:control-class="'icon-arrow-nav-to-parent'"
:enabled="showUp"
@input="resetTreeHere"
/>