File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464 function createHeaderButton ( ) {
6565 const a = document . createElement ( "a" ) ;
6666 a . href = "https://godbolt.org/" ;
67- a . className = "md-button online-compile-header-button" ;
67+ a . className = "md-header__button md-icon online-compile-header-button" ;
6868 a . title = "在线编译(打开 Compiler Explorer)" ;
6969 a . setAttribute ( "aria-label" , a . title ) ;
70- a . textContent = "在线编译" ;
70+ a . innerHTML =
71+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">' +
72+ '<path d="M10 17l6-5-6-5v10ZM19 19H5V5h14v14Zm0-16H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2Z"/>' +
73+ "</svg>" ;
7174
7275 a . addEventListener ( "click" , ( e ) => {
7376 e . preventDefault ( ) ;
Original file line number Diff line number Diff line change 208208 if ( cfg ?. primary && isHexColor ( cfg . primary ) ) primaryInput . value = cfg . primary ;
209209 if ( cfg ?. accent && isHexColor ( cfg . accent ) ) accentInput . value = cfg . accent ;
210210 overlay . hidden = false ;
211+ overlay . style . removeProperty ( "display" ) ;
211212 document . documentElement . classList . add ( "theme-palette-open" ) ;
212213 }
213214
214215 function closePanel ( ) {
215216 overlay . hidden = true ;
217+ overlay . style . display = "none" ;
216218 document . documentElement . classList . remove ( "theme-palette-open" ) ;
217219 }
218220
222224 }
223225
224226 overlay . addEventListener ( "click" , ( e ) => {
225- if ( e . target === overlay ) closePanel ( ) ;
226- } ) ;
227+ const t = e . target ;
228+ if ( ! ( t instanceof Node ) ) return ;
229+ if ( t === overlay ) closePanel ( ) ;
230+ if ( t instanceof Element && t . closest ( ".theme-palette-close" ) ) closePanel ( ) ;
231+ } , { capture : true } ) ;
227232
228- close . addEventListener ( "click" , ( ) => closePanel ( ) ) ;
233+ close . addEventListener ( "click" , ( e ) => {
234+ e . preventDefault ( ) ;
235+ closePanel ( ) ;
236+ } ) ;
229237 document . addEventListener ( "keydown" , ( e ) => {
230238 if ( ! overlay . hidden && e . key === "Escape" ) closePanel ( ) ;
231239 } ) ;
265273 const { overlay, open } = createDialog ( ) ;
266274 document . body . appendChild ( overlay ) ;
267275
276+ overlay . hidden = true ;
277+ overlay . style . display = "none" ;
278+ document . documentElement . classList . remove ( "theme-palette-open" ) ;
279+
268280 ensureHeaderButton ( ( ) => open ( ) ) ;
269281 }
270282
Original file line number Diff line number Diff line change 22 display : inline-flex;
33 align-items : center;
44 justify-content : center;
5- margin-right : 0.5rem ;
6- padding : 0.25rem 0.6rem ;
7- font-size : 0.7rem ;
8- line-height : 1.2 ;
5+ margin-right : 0.25rem ;
96}
107
118.md-header .online-compile-header-button {
129 white-space : nowrap;
1310}
11+
12+ .online-compile-header-button svg {
13+ width : 1.2rem ;
14+ height : 1.2rem ;
15+ }
Original file line number Diff line number Diff line change 1- # QrCraft 开发文档
1+ # QtCraft 开发文档
22
3- 欢迎来到 QrCraft 开发文档。这是一个关于 Qt、C++ 和 QML 开发的学习资源库。
3+ 欢迎来到 QtCraft 开发文档。这是一个关于 Qt、C++ 和 QML 开发的学习资源库。
44
55## 快速导航
66
You can’t perform that action at this time.
0 commit comments