X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=gallery%2Fgallery.js;h=0c0034caf60eabf0b4380d8181fccae62fd444da;hb=866ceb258a016484e30d2c7f96cb6cbb9ff05c8c;hp=14cd34157a21d75ed5fc9dae10f0bf4b2dd2ff09;hpb=605b6119bcc80db4ea100d66df3483425dcd32af;p=dygraphs.git diff --git a/gallery/gallery.js b/gallery/gallery.js index 14cd341..0c0034c 100644 --- a/gallery/gallery.js +++ b/gallery/gallery.js @@ -20,10 +20,12 @@ Gallery.start = function() { Gallery.toc = document.getElementById("toc"); Gallery.workarea = document.getElementById("workarea"); Gallery.subtitle = Gallery.create("div", Gallery.workarea); + Gallery.subtitle.id = "subtitle"; Gallery.workareaChild = Gallery.create("div", Gallery.workarea); - Gallery.workarea.style.visibility = "hidden"; - Gallery.title = document.getElementById("title"); + Gallery.demotitle = document.getElementById("demotitle"); Gallery.textarea = new TextArea(); + Gallery.textarea.width = 600; + Gallery.textarea.height = 400; for (var idx in Gallery.entryOrder) { var id = Gallery.entryOrder[idx]; @@ -49,8 +51,7 @@ Gallery.start = function() { var codeLink = Gallery.create("a", Gallery.subtitle); codeLink.textContent = "code"; codeLink.href = "#"; - Gallery.workarea.style.visibility = "visible"; - Gallery.title.textContent = demo.title ? demo.title : ""; + Gallery.demotitle.textContent = demo.title ? demo.title : ""; demo.innerDiv.className = "selected"; Gallery.workareaChild.id = id; location.hash = "g/" + id; @@ -87,6 +88,8 @@ Gallery.hashChange = function(event) { var id = location.hash.substring(3) + "-toc"; var elem = document.getElementById(id); elem.onclick(); + return; } } + Gallery.workareaChild.innerHTML = "

Select a demo from the gallery on the left

" };