Merge branch 'remove-jquery-from-notebook-viewer' into 'master'
Remove jQuery from IPython notebook viewer See merge request !10315
This commit is contained in:
commit
4cf16426da
1 changed files with 10 additions and 6 deletions
|
@ -63,16 +63,20 @@ export default () => {
|
|||
},
|
||||
},
|
||||
mounted() {
|
||||
$('<link>', {
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: gon.katex_css_url,
|
||||
}).appendTo('head');
|
||||
if (gon.katex_css_url) {
|
||||
const katexStyles = document.createElement('link');
|
||||
katexStyles.setAttribute('rel', 'stylesheet');
|
||||
katexStyles.setAttribute('href', gon.katex_css_url);
|
||||
document.head.appendChild(katexStyles);
|
||||
}
|
||||
|
||||
if (gon.katex_js_url) {
|
||||
$.getScript(gon.katex_js_url, () => {
|
||||
const katexScript = document.createElement('script');
|
||||
katexScript.addEventListener('load', () => {
|
||||
this.loadFile();
|
||||
});
|
||||
katexScript.setAttribute('src', gon.katex_js_url);
|
||||
document.head.appendChild(katexScript);
|
||||
} else {
|
||||
this.loadFile();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue