mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-04 02:05:16 +02:00
Render the formula symbols of the properties.
This commit is contained in:
parent
da09873be5
commit
0fd677d2fd
5 changed files with 42 additions and 207 deletions
|
@ -91,6 +91,11 @@ require('./jquery.tristate.js');
|
|||
|
||||
require('darkmode-js');
|
||||
|
||||
//Equation rendering
|
||||
require('katex');
|
||||
window.renderMathInElement = require('katex/contrib/auto-render/auto-render').default;
|
||||
import 'katex/dist/katex.css';
|
||||
|
||||
window.ClipboardJS = require('clipboard');
|
||||
|
||||
window.QRCode = require('qrcode');
|
||||
|
|
|
@ -552,6 +552,21 @@ $(document).on("ajaxUI:reload", function() {
|
|||
})
|
||||
});
|
||||
|
||||
//Register latex rendering
|
||||
$(document).on("ajaxUI:reload ajaxUI:start", function() {
|
||||
$('.latex').each(function(index, element) {
|
||||
//@ts-ignore
|
||||
window.renderMathInElement(element, {
|
||||
delimiters: [
|
||||
{left: "$$", right: "$$", display: true},
|
||||
{left: "$", right: "$", display: false},
|
||||
{left: "\\(", right: "\\)", display: false},
|
||||
{left: "\\[", right: "\\]", display: true}
|
||||
]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//Need for proper body padding, with every navbar height
|
||||
$(window).resize(function () {
|
||||
let height : number = $('#navbar').height() + 10;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue