diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-09 02:52:05 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-10 16:21:58 +0300 |
commit | 00fc9f260706cfd6d6f4261eea24eb3ff455b3e0 (patch) | |
tree | c09dc1e2fccd2a4b5e0cce613465ec367133a5dd /app/assets/javascripts/blob/viewer/index.js | |
parent | ecc6cc8be75b5c66fdf7f5595b71aabf9366a5e1 (diff) |
Load tree readme asynchronously
Diffstat (limited to 'app/assets/javascripts/blob/viewer/index.js')
-rw-r--r-- | app/assets/javascripts/blob/viewer/index.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/blob/viewer/index.js b/app/assets/javascripts/blob/viewer/index.js index 07d67d49aa5..69ff2f95799 100644 --- a/app/assets/javascripts/blob/viewer/index.js +++ b/app/assets/javascripts/blob/viewer/index.js @@ -8,7 +8,10 @@ export default class BlobViewer { this.richViewer = document.querySelector('.blob-viewer[data-type="rich"]'); this.$fileHolder = $('.file-holder'); - let initialViewerName = document.querySelector('.blob-viewer:not(.hidden)').getAttribute('data-type'); + const initialViewer = document.querySelector('.blob-viewer:not(.hidden)'); + if (!initialViewer) return; + + let initialViewerName = initialViewer.getAttribute('data-type'); this.initBindings(); |