From 313258fa423f9c3a03e793e2a7bc8686d0757e91 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 20 Mar 2017 14:44:07 +0000 Subject: Stops errors in the rendering breaking the page Fixed some output types [ci skip] --- app/assets/javascripts/blob/notebook_viewer.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'app/assets/javascripts/blob') diff --git a/app/assets/javascripts/blob/notebook_viewer.js b/app/assets/javascripts/blob/notebook_viewer.js index 057afc9b2e5..4bd80393d17 100644 --- a/app/assets/javascripts/blob/notebook_viewer.js +++ b/app/assets/javascripts/blob/notebook_viewer.js @@ -5,6 +5,10 @@ import NotebookLab from 'vendor/notebooklab'; Vue.use(VueResource); Vue.use(NotebookLab); +Vue.config.errorHandler = (err) => { + console.log(err); +} + $(() => { const el = document.getElementById('js-notebook-viewer'); @@ -12,6 +16,7 @@ $(() => { el, data() { return { + error: false, loading: true, json: {}, }; @@ -28,14 +33,11 @@ $(() => { `, mounted() { - $.get(gon.katex_css_url, () => { - const css = $('', { - rel: 'stylesheet', - type: 'text/css', - href: gon.katex_css_url, - }); - css.appendTo('head'); - }); + $('', { + rel: 'stylesheet', + type: 'text/css', + href: gon.katex_css_url, + }).appendTo('head'); $.getScript(gon.katex_js_url, () => { this.$http.get(el.dataset.endpoint) -- cgit v1.2.1