fix: load api_doc.css in header.tmpl, revert JS hack
This commit is contained in:
parent
c8941a5b84
commit
6fe0919f8a
@ -17,21 +17,11 @@ bricks.ApiDoc = class extends bricks.VBox {
|
|||||||
this.api_base_url = this.opts.base_url || '';
|
this.api_base_url = this.opts.base_url || '';
|
||||||
this.sections = [];
|
this.sections = [];
|
||||||
this.active_section = null;
|
this.active_section = null;
|
||||||
bricks.ApiDoc._ensure_css();
|
|
||||||
this._build_layout();
|
this._build_layout();
|
||||||
var self = this;
|
var self = this;
|
||||||
schedule_once(function() { self._load(); }, 0.1);
|
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() {
|
_build_layout() {
|
||||||
var d = this.dom_element;
|
var d = this.dom_element;
|
||||||
d.classList.add('bricks-apidoc');
|
d.classList.add('bricks-apidoc');
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<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/3parties/xterm.css')}}" />
|
||||||
<link rel="stylesheet" href="{{entire_url('/bricks/css/bricks.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() %}
|
{% for mycss in cssfiles() %}
|
||||||
<link rel="stylesheet" href="{{entire_url(mycss)}}">
|
<link rel="stylesheet" href="{{entire_url(mycss)}}">
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user