fix: load api_doc.css in header.tmpl, revert JS hack

This commit is contained in:
yumoqing 2026-06-02 20:28:36 +08:00
parent c8941a5b84
commit 6fe0919f8a
2 changed files with 1 additions and 10 deletions

View File

@ -17,21 +17,11 @@ bricks.ApiDoc = class extends bricks.VBox {
this.api_base_url = this.opts.base_url || '';
this.sections = [];
this.active_section = null;
bricks.ApiDoc._ensure_css();
this._build_layout();
var self = this;
schedule_once(function() { self._load(); }, 0.1);
}
static _ensure_css() {
if (bricks.ApiDoc._css_loaded) return;
bricks.ApiDoc._css_loaded = true;
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = bricks.absurl('/bricks/css/api_doc.css');
document.head.appendChild(link);
}
_build_layout() {
var d = this.dom_element;
d.classList.add('bricks-apidoc');

View File

@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="{{entire_url('/bricks/3parties/xterm.css')}}" />
<link rel="stylesheet" href="{{entire_url('/bricks/css/bricks.css')}}">
<link rel="stylesheet" href="{{entire_url('/bricks/css/api_doc.css')}}">
{% for mycss in cssfiles() %}
<link rel="stylesheet" href="{{entire_url(mycss)}}">
{% endfor %}