mirror of
https://github.com/storytold/spark.git
synced 2026-10-18 07:40:38 +00:00
Fix examples page iframe URL
This commit is contained in:
+2
-4
@@ -221,14 +221,12 @@
|
|||||||
panel.querySelectorAll('.example-link').forEach((link) => {
|
panel.querySelectorAll('.example-link').forEach((link) => {
|
||||||
link.addEventListener('click', (e) => {
|
link.addEventListener('click', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const path = link.getAttribute('href').substring(1);
|
const path = link.getAttribute('href');
|
||||||
iframe.src = path;
|
iframe.src = path;
|
||||||
|
|
||||||
console.log('path:', path);
|
|
||||||
document.querySelectorAll('.example-link').forEach(l => l.classList.remove('active'));
|
document.querySelectorAll('.example-link').forEach(l => l.classList.remove('active'));
|
||||||
link.classList.add('active');
|
link.classList.add('active');
|
||||||
codeButton.href = `https://github.com/forge-gfx/forge/blob/main/${path}`;
|
codeButton.href = `https://github.com/forge-gfx/forge/blob/main/${path.substring(1)}`;
|
||||||
console.log('codeButton href:', codeButton.href);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user