From: Robert Konigsberg Date: Mon, 27 Feb 2012 13:04:37 +0000 (-0500) Subject: Gallery code links reset the URL anchor. This fixes it. X-Git-Tag: v1.0.0~319 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=a6c2695d36ff7773e4e0b82236bb5f39b1bc0bdb;p=dygraphs.git Gallery code links reset the URL anchor. This fixes it. --- diff --git a/gallery/gallery.css b/gallery/gallery.css index 7bd3510..74bbbef 100644 --- a/gallery/gallery.css +++ b/gallery/gallery.css @@ -47,6 +47,11 @@ aside { color: #090; } +#code a:hover { + color: blue; + cursor: pointer; +} + #demotitle { text-align: center; font-size: 1.5em; diff --git a/gallery/gallery.js b/gallery/gallery.js index b735693..121f541 100644 --- a/gallery/gallery.js +++ b/gallery/gallery.js @@ -53,23 +53,23 @@ Gallery.start = function() { Gallery.demotitle.textContent = demo.title ? demo.title : ""; demo.innerDiv.className = "selected"; - var htmlLink = Gallery.create("a", Gallery.subtitle); + var codeSpan = Gallery.create("span", Gallery.subtitle); + codeSpan.id = "code"; + + var htmlLink = Gallery.create("a", codeSpan); htmlLink.textContent = "HTML"; - htmlLink.href = "#"; - Gallery.subtitle.appendChild(document.createTextNode(" ")); + codeSpan.appendChild(document.createTextNode(" ")); - var javascriptLink = Gallery.create("a", Gallery.subtitle); + var javascriptLink = Gallery.create("a", codeSpan); javascriptLink.textContent = "Javascript"; - javascriptLink.href = "#"; - Gallery.subtitle.appendChild(document.createTextNode(" ")); + codeSpan.appendChild(document.createTextNode(" ")); var css = getCss(id); if (css) { - var cssLink = Gallery.create("a", Gallery.subtitle); + var cssLink = Gallery.create("a", codeSpan); cssLink.textContent = "CSS"; - cssLink.href = "#"; } Gallery.workareaChild.id = id;