Skip to content

Commit

Permalink
Fix missing ref issue for lazy load components while the page is stil…
Browse files Browse the repository at this point in the history
…l loading
  • Loading branch information
akhuoa committed May 31, 2024
1 parent f716e45 commit 1495606
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/components/ContentVuer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ export default {
},
methods: {
flatmapProvenacneReady: function(prov) {
this.$refs.contentBar.setupFlatmapContextCard(prov);
this.$refs.contentBar?.setupFlatmapContextCard(prov);
},
/**
* Toggle sync mode on/off depending on species and current state
*/
toggleSyncMode: function () {
this.$refs.viewer.toggleSyncMode();
this.$refs.viewer?.toggleSyncMode();
},
getId: function () {
return this.entry.id;
},
getState: function () {
return this.$refs.viewer.getState();
return this.$refs.viewer?.getState();
},
resourceSelected: function (payload) {
this.$emit("resource-selected", payload);
Expand All @@ -101,32 +101,32 @@ export default {
this.entriesStore.updateViewForEntry({id: this.entry.id, viewUrl});
} else {
//Manually set it as it cannot be set with reactivity
this.$refs.viewer.updateWithViewUrl(viewUrl);
this.$refs.viewer?.updateWithViewUrl(viewUrl);
}
},
/**
* Perform a local search on this contentvuer
*/
search: function (term) {
return this.$refs.viewer.search(term);
return this.$refs.viewer?.search(term);
},
/**
* Push the suggested terms into the suggestions array
*/
searchSuggestions: function(term, suggestions) {
this.$refs.viewer.searchSuggestions(term, suggestions);
this.$refs.viewer?.searchSuggestions(term, suggestions);
},
setPanesBoundary: function() {
this.$refs.contentBar.setBoundary(this.$refs["container"][0]);
this.$refs.contentBar?.setBoundary(this.$refs["container"][0]);
},
speciesChanged: function (species) {
this.activeSpecies = species;
},
receiveSynchronisedEvent: async function (data) {
this.$refs.viewer.receiveSynchronisedEvent(data);
this.$refs.viewer?.receiveSynchronisedEvent(data);
},
requestSynchronisedEvent: function (flag) {
this.$refs.viewer.requestSynchronisedEvent(flag);
this.$refs.viewer?.requestSynchronisedEvent(flag);
},
/**
* Check if this viewer is currently visible
Expand All @@ -136,7 +136,7 @@ export default {
return paneName !== undefined;
},
onResize: function () {
this.$refs.viewer.onResize();
this.$refs.viewer?.onResize();
},
},
data: function () {
Expand Down

0 comments on commit 1495606

Please sign in to comment.