X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=gallery%2Fgallery.js;h=0c0034caf60eabf0b4380d8181fccae62fd444da;hb=1357d81ebb85b87b69a9de0eb01c5d8cb43774d2;hp=5a907bb4ad19d7f6a65ecee77bbdfd99dfb9e691;hpb=60bda09c058d85b1fad278ac4ce6df353e0a9275;p=dygraphs.git diff --git a/gallery/gallery.js b/gallery/gallery.js index 5a907bb..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; } } -}; \ No newline at end of file + Gallery.workareaChild.innerHTML = "