mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-09 16:01:30 +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");
|
||||
initializeFullZoom();
|
||||
}
|
||||
window.navigatorContainer.reloadChildrenLevel = true;
|
||||
}
|
||||
|
||||
jsPlumb.ready(function () {
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@
|
|||
|
||||
function refreshCurrentView() {
|
||||
loadCardsView();
|
||||
window.navigatorContainer.reloadChildrenLevel = true;
|
||||
}
|
||||
|
||||
function selectDate($field) {
|
||||
|
|
|
|||
|
|
@ -44,12 +44,13 @@ export default {
|
|||
data: function() {
|
||||
return {
|
||||
childrenExpanded: false,
|
||||
childrenLoaded: false,
|
||||
children: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
hasChildren: function() {
|
||||
return this.item.has_children;
|
||||
return this.item.has_children || this.children.length > 0;
|
||||
},
|
||||
sortedMenuItems: function() {
|
||||
return this.children.sort((a, b) => {
|
||||
|
|
@ -93,6 +94,13 @@ export default {
|
|||
if (this.reloadCurrentLevel && this.children.find((item) => item.id == this.currentItemId)) {
|
||||
this.loadChildren();
|
||||
}
|
||||
},
|
||||
children: function() {
|
||||
if (this.children.length > 0) {
|
||||
this.childrenExpanded = true;
|
||||
} else if (this.childrenLoaded) {
|
||||
this.item.has_children = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -103,6 +111,7 @@ export default {
|
|||
loadChildren: function() {
|
||||
$.get(this.item.children_url, {archived: this.archived}, (data) => {
|
||||
this.children = data.items;
|
||||
this.childrenLoaded = true;
|
||||
});
|
||||
},
|
||||
treeExpand: function() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue