Turn our lib into an es6 module

This commit is contained in:
Jeremy Wall 2024-03-03 18:15:41 -05:00
parent fb48c6900c
commit 17e6ae81a0
2 changed files with 4 additions and 3 deletions

View File

@ -191,7 +191,7 @@ pub fn mk_ui_routes(config: Arc<Vec<Dashboard>>) -> Router<Config> {
fn graph_lib_prelude() -> Markup {
html! {
script src="/js/plotly.js" { }
script defer src="/js/lib.js" { }
script type="module" defer src="/js/lib.js" { }
link rel="stylesheet" href="/static/site.css" { }
}
}

View File

@ -55,7 +55,7 @@ function getCssVariableValue(variableName) {
*
* @extends HTMLElement
*/
class GraphPlot extends HTMLElement {
export class GraphPlot extends HTMLElement {
/** @type {?string} */
#uri;
/** @type {?number} */
@ -457,7 +457,7 @@ class GraphPlot extends HTMLElement {
GraphPlot.registerElement();
/** Custom Element for selecting a timespan for the dashboard. */
class SpanSelector extends HTMLElement {
export class SpanSelector extends HTMLElement {
/** @type {HTMLElement} */
#targetNode = null;
/** @type {HTMLInputElement} */
@ -518,3 +518,4 @@ class SpanSelector extends HTMLElement {
}
SpanSelector.registerElement();