各イベントにコメントを追加
This commit is contained in:
parent
88efcfe931
commit
8a4468b2ab
1 changed files with 3 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
const baseURL = `https://${PUBLIC_HOSTNAME}${base}`
|
const baseURL = `https://${PUBLIC_HOSTNAME}${base}`
|
||||||
|
|
||||||
|
// toggle code frame
|
||||||
onMount(()=>{
|
onMount(()=>{
|
||||||
let toggleHide = function(e:MessageEvent){
|
let toggleHide = function(e:MessageEvent){
|
||||||
if (e.data.message === 'toggleHide') {
|
if (e.data.message === 'toggleHide') {
|
||||||
|
@ -32,6 +33,7 @@
|
||||||
return ()=>{window.removeEventListener('message', toggleHide)}
|
return ()=>{window.removeEventListener('message', toggleHide)}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// header marker
|
||||||
onMount(()=>{
|
onMount(()=>{
|
||||||
function setMarkerClass(id:string) {
|
function setMarkerClass(id:string) {
|
||||||
let hash = document.querySelector("#blog .marker");
|
let hash = document.querySelector("#blog .marker");
|
||||||
|
@ -58,6 +60,7 @@
|
||||||
return ()=>{window.removeEventListener('hashchange', hashChange)}
|
return ()=>{window.removeEventListener('hashchange', hashChange)}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// copy code
|
||||||
onMount(()=>{
|
onMount(()=>{
|
||||||
document.getElementById('blog')?.addEventListener('click',(e:MouseEvent)=>{
|
document.getElementById('blog')?.addEventListener('click',(e:MouseEvent)=>{
|
||||||
if (e.target instanceof HTMLElement && e.target.matches('pre')) {
|
if (e.target instanceof HTMLElement && e.target.matches('pre')) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue