summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac Koalar <hi@guhub.cn>2022-09-25 14:34:30 +0800
committerEltrac Koalar <hi@guhub.cn>2022-09-25 14:34:30 +0800
commitfd0a662000ae32140ad76e14db2de995493c6913 (patch)
tree4e0b9cde5dece664697f31bc927b349d32009394
parenta6221e1c82a93561b7f67fabbb095bdc703e9415 (diff)
:bug: Fix: Prism toolbar 重复注册
-rw-r--r--assets/matcha/matcha.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/assets/matcha/matcha.js b/assets/matcha/matcha.js
index 011d40a..86d6516 100644
--- a/assets/matcha/matcha.js
+++ b/assets/matcha/matcha.js
@@ -61,15 +61,15 @@ var prismLoad = function(){
pres[i].className = 'line-numbers';}
Prism.highlightAll(true,null);
}
- Prism.plugins.toolbar.registerButton('copy', {
- text: '',
- onClick: function (env) {
- var text = env.element.innerText;
- navigator.clipboard.writeText(text);
- toast('已将代码复制到剪切板');
- }
- });
};
+Prism.plugins.toolbar.registerButton('copy', {
+ text: '',
+ onClick: function (env) {
+ var text = env.element.innerText;
+ navigator.clipboard.writeText(text);
+ toast('已将代码复制到剪切板');
+ }
+});
//jquery.lazy.js loader
lazyloader = function(){
$('.lazy').Lazy({