mirror of
https://github.com/scratchfoundation/scratchx.git
synced 2025-02-17 19:30:20 -05:00
Make logo go to home, fix click handler
This commit is contained in:
parent
a473ebf565
commit
34d59aab3e
2 changed files with 8 additions and 6 deletions
|
@ -12,7 +12,7 @@
|
|||
<main>
|
||||
<header>
|
||||
<div>
|
||||
<h1 class="scratchx-logo"><span>ScratchX</span></h1>
|
||||
<a href="#home" data-staticlink="home"><h1 class="scratchx-logo"><span>ScratchX</span></h1></a>
|
||||
<nav class="main-nav">
|
||||
Related Sites:
|
||||
<ul>
|
||||
|
|
|
@ -104,6 +104,13 @@ swfobject.switchOffAutoHideShow();
|
|||
swfobject.embedSWF('Scratch.swf', 'editor', '100%', '100%', '11.7.0', 'libs/expressInstall.swf',
|
||||
flashVars, params, null, handleEmbedStatus);
|
||||
|
||||
/* Page switching */
|
||||
|
||||
$("[data-staticlink]").click(function(e) {
|
||||
e.preventDefault();
|
||||
showPage($(this).attr("data-staticlink"));
|
||||
});
|
||||
|
||||
function showPage(path) {
|
||||
var toHide = "body > main, body > main > article, #editor";
|
||||
var toShow = "#" + path;
|
||||
|
@ -113,11 +120,6 @@ function showPage(path) {
|
|||
$(toShow).show();
|
||||
}
|
||||
|
||||
$("[data-staticlink]").click(function(e) {
|
||||
e.preventDefault();
|
||||
showPage(e.target.attributes['data-staticlink'].value)
|
||||
});
|
||||
|
||||
var initialID = "home";
|
||||
function initPage() {
|
||||
if (window.location.hash) initialID = window.location.hash.substr(1);
|
||||
|
|
Loading…
Reference in a new issue