Gallery code links reset the URL anchor. This fixes it.
authorRobert Konigsberg <konigsberg@google.com>
Mon, 27 Feb 2012 13:04:37 +0000 (08:04 -0500)
committerRobert Konigsberg <konigsberg@google.com>
Mon, 27 Feb 2012 13:04:37 +0000 (08:04 -0500)
gallery/gallery.css
gallery/gallery.js

index 7bd3510..74bbbef 100644 (file)
@@ -47,6 +47,11 @@ aside {
   color: #090;
 }
 
+#code a:hover {
+  color: blue;
+  cursor: pointer;
+}
+
 #demotitle {
   text-align: center;
   font-size: 1.5em;
index b735693..121f541 100644 (file)
@@ -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;