mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-10 08:21:37 +08:00
Merge pull request #5361 from aignatov-bio/ai-sci-8390-fix-navigator-update
Fix navigator update [SCI-8390]
This commit is contained in:
commit
ef0cacfded
3 changed files with 12 additions and 1 deletions
|
|
@ -148,6 +148,7 @@ function init() {
|
||||||
initializeGraph(".diagram .module-large");
|
initializeGraph(".diagram .module-large");
|
||||||
initializeFullZoom();
|
initializeFullZoom();
|
||||||
}
|
}
|
||||||
|
window.navigatorContainer.reloadChildrenLevel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
jsPlumb.ready(function () {
|
jsPlumb.ready(function () {
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@
|
||||||
|
|
||||||
function refreshCurrentView() {
|
function refreshCurrentView() {
|
||||||
loadCardsView();
|
loadCardsView();
|
||||||
|
window.navigatorContainer.reloadChildrenLevel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectDate($field) {
|
function selectDate($field) {
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,13 @@ export default {
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
childrenExpanded: false,
|
childrenExpanded: false,
|
||||||
|
childrenLoaded: false,
|
||||||
children: []
|
children: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hasChildren: function() {
|
hasChildren: function() {
|
||||||
return this.item.has_children;
|
return this.item.has_children || this.children.length > 0;
|
||||||
},
|
},
|
||||||
sortedMenuItems: function() {
|
sortedMenuItems: function() {
|
||||||
return this.children.sort((a, b) => {
|
return this.children.sort((a, b) => {
|
||||||
|
|
@ -93,6 +94,13 @@ export default {
|
||||||
if (this.reloadCurrentLevel && this.children.find((item) => item.id == this.currentItemId)) {
|
if (this.reloadCurrentLevel && this.children.find((item) => item.id == this.currentItemId)) {
|
||||||
this.loadChildren();
|
this.loadChildren();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
children: function() {
|
||||||
|
if (this.children.length > 0) {
|
||||||
|
this.childrenExpanded = true;
|
||||||
|
} else if (this.childrenLoaded) {
|
||||||
|
this.item.has_children = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -103,6 +111,7 @@ export default {
|
||||||
loadChildren: function() {
|
loadChildren: function() {
|
||||||
$.get(this.item.children_url, {archived: this.archived}, (data) => {
|
$.get(this.item.children_url, {archived: this.archived}, (data) => {
|
||||||
this.children = data.items;
|
this.children = data.items;
|
||||||
|
this.childrenLoaded = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
treeExpand: function() {
|
treeExpand: function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue