Skip to content

Commit

Permalink
add clicking on an item eye in left menu should always trigger a tree…
Browse files Browse the repository at this point in the history
… relative to the focused item.

Close 35
  • Loading branch information
shuart committed Jun 4, 2019
1 parent 1b8beb3 commit 65f4864
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ephemeris",
"version": "2.6.1",
"version": "2.7.0",
"description": "System Engineering and requirements management application",
"main": "index.js",
"scripts": {
Expand Down
16 changes: 15 additions & 1 deletion src/js/components/comp.treeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ var createTreeList = function ({
contentFunction = undefined,
onToogleVisibility=undefined,
customEyeActionClass="",
customEyeIconClass=undefined,
customTextActionClass="",
customExtraActionClass="",
arrayOfHiddenItems = undefined//unused
}={}) {
var self ={};
Expand All @@ -21,19 +23,31 @@ var createTreeList = function ({
html =`
<div data-id="${i[identifier]}" class="searchable_item list-item">
<span data-id="${i[identifier]}" >${valueFunction(i)}</span>
${theme.itemExtraIcon(i)}
<i data-id="${i[identifier]} style="opacity:0.2" class="${customEyeActionClass} far ${visibility ? "fa-eye-slash":"fa-eye" }"></i>
<div data-id="${i[identifier]}" >${contentFunction ? contentFunction(i):"" }</div>
</div>`

return html
}

theme.itemExtraIcon = function (i) {
if (customExtraActionClass != "") {
html =`
<i data-label="${i.labels? i.labels[0]:''}" data-id="${i[identifier]}" style="opacity:0.2" class="${customExtraActionClass}"></i>
`
return html
}
return ""
}
theme.itemLeaf = function (i, branchesHTML, caret,childrenAreClosed) {
html =`
<div class="tree_leaf">
<div data-id="${i[identifier]}" class="searchable_item list-item">
<span>${getCartStyle(caret, childrenAreClosed)}</span>
<span class="relaxed ${customTextActionClass}" data-id="${i[identifier]}" >${valueFunction(i)}</span>
<i data-label="${i.labels? i.labels[0]:''}" data-id="${i[identifier]}" style="opacity:0.2" class="far fa-eye ${customEyeActionClass}"></i>
${theme.itemExtraIcon(i)}
<i data-label="${i.labels? i.labels[0]:''}" data-id="${i[identifier]}" style="opacity:0.2" class="${customEyeIconClass? customEyeIconClass:"far fa-eye"} ${customEyeActionClass}"></i>
<div data-id="${i[identifier]}" >${contentFunction ? contentFunction(i):"" }</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/js/views/view.leftMenu.projectTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ var createLeftMenuProjectTree = function () {
var relations = store.currentPbs.links.map((e) => {e.customColor="#6dce9e";e.type = "Composed by"; return e})

document.querySelector(".left-menu-area .title").innerHTML = "Overview"

sideListe = createTreeList({
container:document.querySelector(".left-list"),
items: itemsToDisplay,
links:relations,
customEyeActionClass:"action_toogle_diag_relations_options",
customEyeIconClass:"fas fa-link",
customTextActionClass:"action_LM_project_tree_show_item_popup"
})
// updateSideListeVisibility()
Expand Down
4 changes: 2 additions & 2 deletions src/js/views/view.relations.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ var createRelationsView = function () {
container.style.height = "100%"

listContainer = document.createElement("div")
listContainer.style.height = "100%"
document.querySelector(".left-list").appendChild(listContainer)
connections(container)
//update all connections at each render. otherwise multiple views share the updae
Expand Down Expand Up @@ -469,7 +468,8 @@ var createRelationsView = function () {
container:listContainer,
items: itemsToDisplay,
links:relations,
customEyeActionClass:"action_tree_list_relations_toogle_visibility"
customEyeActionClass:"action_tree_list_relations_toogle_visibility",
customExtraActionClass:"fas fa-link action_toogle_diag_relations_options"
})
updateSideListeVisibility()
}
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Ephemeris",
"version": "2.6.1",
"version": "2.7.0",
"description": "System Engineering and requirements management application",
"main": "index.html",
"window": {
Expand Down

0 comments on commit 65f4864

Please sign in to comment.