summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-12-20 17:55:53 -0600
committerJose Ivan Vargas <jvargas@gitlab.com>2017-12-21 12:08:32 -0600
commit2f0335e1978799eb44eec715d37a16b116a31140 (patch)
tree0a186e1ec4bcb08ece4d4605babe385df9f5dfc7 /app
parentad9e3dfe5d3d8136ae659b4de9f37af9f6b5462f (diff)
downloadgitlab-ce-2f0335e1978799eb44eec715d37a16b116a31140.tar.gz
Removed the remains of katex from vendor assets and load everything via webpack
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/render_math.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/app/assets/javascripts/render_math.js b/app/assets/javascripts/render_math.js
index 2e68a9642e7..341fb842cbe 100644
--- a/app/assets/javascripts/render_math.js
+++ b/app/assets/javascripts/render_math.js
@@ -1,4 +1,5 @@
// import katex from 'katex';
+// import katexCSS from 'katex/dist/katex.css';
import Flash from './flash';
// Renders math using KaTeX in any element with the
@@ -28,16 +29,13 @@ function renderWithKaTeX(elements, katex) {
export default function renderMath($els) {
if (!$els.length) return;
-
import(/* webpackChunkName: 'katex' */ 'katex').then((katex) => {
- $.get(gon.katex_css_url, () => {
- const css = $('<link>', {
- rel: 'stylesheet',
- type: 'text/css',
- href: gon.katex_css_url,
- });
- css.appendTo('head');
+ import(/* webpackChunkName: 'katex' */ 'katex/dist/katex.css')
+ .then(() => {
renderWithKaTeX($els, katex);
+ })
+ .catch((err) => {
+ Flash(`Can't load katex css ${err}`);
});
}).catch((err) => {
Flash(`Can't load katex module: ${err}`);