Commit bd28dd0 1 parent 06dad8c commit bd28dd0 Copy full SHA for bd28dd0
File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -77,15 +77,16 @@ document.addEventListener('DOMContentLoaded', function () {
77
77
processMenuLinks ( entityLinks ) ;
78
78
var indexLinks = document . querySelectorAll ( '[data-type="index-link"]' ) ;
79
79
processMenuLinks ( indexLinks , true ) ;
80
- var entityLogos = document . querySelectorAll ( '[data-type="compodoc-logo"]' ) ;
81
- var processLogos = function ( entityLogo ) {
80
+ var compodocLogos = document . querySelectorAll ( '[data-type="compodoc-logo"]' ) ;
81
+ var customLogo = document . querySelectorAll ( '[data-type="custom-logo"]' ) ;
82
+ var processLogos = function ( entityLogos ) {
82
83
for ( var i = 0 ; i < entityLogos . length ; i ++ ) {
83
84
var entityLogo = entityLogos [ i ] ;
84
85
if ( entityLogo ) {
85
86
var url = entityLogo . getAttribute ( 'data-src' ) ;
86
87
// Dark mode + logo
87
88
let isDarkMode = window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ;
88
- if ( isDarkMode ) {
89
+ if ( isDarkMode && url . indexOf ( 'compodoc' ) !== - 1 ) {
89
90
url = 'images/compodoc-vectorise-inverted.png' ;
90
91
}
91
92
if ( url . charAt ( 0 ) !== '.' ) {
@@ -115,7 +116,8 @@ document.addEventListener('DOMContentLoaded', function () {
115
116
}
116
117
}
117
118
} ;
118
- processLogos ( entityLogos ) ;
119
+ processLogos ( compodocLogos ) ;
120
+ processLogos ( customLogo ) ;
119
121
120
122
setTimeout ( function ( ) {
121
123
document . getElementById ( 'btn-menu' ) . addEventListener ( 'click' , function ( ) {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ customElements.define('compodoc-menu', class extends HTMLElement {
17
17
<li class =" title" >
18
18
{{ #if customLogo }}
19
19
<a href =" index.html" data-type =" index-link" >
20
- <img alt =" " class =" img-responsive" data-type =" custom-logo" src ={{ strip-url " / images/" customLogo }} >
20
+ <img alt =" " class =" img-responsive" data-type =" custom-logo" data- src =" {{ strip-url " images/" customLogo }} " >
21
21
</a >
22
22
{{ else }}
23
23
<a href =" index.html" data-type =" index-link" >{{ documentationMainName }} </a >
You can’t perform that action at this time.
0 commit comments