Przeglądaj źródła

fix: theme mode sync with new header design site

DaiQiangReal 3 lat temu
rodzic
commit
fc4a7b72cc
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      src/templates/toUEDUtils/toUED.ts

+ 4 - 1
src/templates/toUEDUtils/toUED.ts

@@ -20,7 +20,7 @@ const getAnotherSideUrl=(site:'design'|'main')=>{
 };
 
 
-const cache={scrollHeight:null};
+const cache={ scrollHeight:null };
 
 const transContent=(site:'main'|'design')=>{
     const url=`${getAnotherSideUrl('design')}?concisemode=true`;
@@ -57,6 +57,8 @@ const transContent=(site:'main'|'design')=>{
                         iframeContainer.style['height']=`${data['scrollHeight']}px`;
                         console.log('height===>',data['scrollHeight']);
                         cache['scrollHeight']=`${data['scrollHeight']}px`;
+                        // @ts-ignore
+                        iframeDOM?.contentWindow?.semidoc?.setDarkmode(document.body.getAttribute('theme-mode')==='dark');
                     }
                 } catch (e){
                     console.log('getMessage ====>',e);
@@ -66,6 +68,7 @@ const transContent=(site:'main'|'design')=>{
 
             const contentAreaDOM=document.querySelector('.article-wrapper');
             contentAreaDOM.appendChild(iframeContainer);
+
         }