summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMarc Hartmayer <hello@hartmayer.com>2020-05-24 11:00:47 +0200
committerMarc Hartmayer <hello@hartmayer.com>2020-05-24 11:28:05 +0200
commitd5fbd50b760b1d3b84b5b4e8af3a8ed7608e2918 (patch)
treecf8a639ad0f62aa864c49803015effc202a198e4 /client
parent06515559a62a9caea7e31326c381dac0d40f710b (diff)
downloadwekan-d5fbd50b760b1d3b84b5b4e8af3a8ed7608e2918.tar.gz
wekan-d5fbd50b760b1d3b84b5b4e8af3a8ed7608e2918.tar.bz2
wekan-d5fbd50b760b1d3b84b5b4e8af3a8ed7608e2918.zip
Make scrollParentContainer() more robust as it's used in a timeout callback
Example exception: Exception in setTimeout callback: TypeError: Cannot read property 'parentComponent' of null at constructor.scrollParentContainer (cardDetails.js:77) at cardDetails.js:190 at Meteor.EnvironmentVariable.EVp.withValue (meteor.js?hash=857dafb4b9dff17e29ed8498a22ea5b1a3d6b41d:1207) at meteor.js?hash=857dafb4b9dff17e29ed8498a22ea5b1a3d6b41d:588 at meteor.js?hash=857dafb4b9dff17e29ed8498a22ea5b1a3d6b41d:1234 Probably there is a better fix for this.
Diffstat (limited to 'client')
-rw-r--r--client/components/cards/cardDetails.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 441068b0..11e010d4 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -74,11 +74,18 @@ BlazeComponent.extendComponent({
scrollParentContainer() {
const cardPanelWidth = 510;
- const bodyBoardComponent = this.parentComponent().parentComponent();
+ const parentComponent = this.parentComponent();
+ // TODO sometimes parentComponent is not available, maybe because it's not
+ // yet created?!
+ if (!parentComponent) return;
+ const bodyBoardComponent = parentComponent.parentComponent();
//On Mobile View Parent is Board, Not Board Body. I cant see how this funciton should work then.
if (bodyBoardComponent === null) return;
const $cardView = this.$(this.firstNode());
const $cardContainer = bodyBoardComponent.$('.js-swimlanes');
+ // TODO sometimes cardContainer is not available, maybe because it's not yet
+ // created?!
+ if (!$cardContainer) return;
const cardContainerScroll = $cardContainer.scrollLeft();
const cardContainerWidth = $cardContainer.width();