Show/hide the editor by putting it on/off screen

This commit is contained in:
Ray Schamp 2015-05-06 15:06:32 -04:00
parent e4180f8adb
commit 32a4a9b3e3
4 changed files with 12 additions and 5 deletions

View file

@ -1027,7 +1027,8 @@ body > main > header {
#editor { #editor {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; } height: 100%;
top: -9999px; }
.scratch_unsupported p { .scratch_unsupported p {
color: #aaa; color: #aaa;

File diff suppressed because one or more lines are too long

View file

@ -155,12 +155,17 @@ $("[data-staticlink]").click(function(e) {
}); });
function showPage(path) { function showPage(path) {
var toHide = "body > main, body > main > article, #editor"; var toHide = "body > main, body > main > article";
var toShow = "#" + path; var toShow = "#" + path;
var $toShow = $(toShow);
$(toHide).hide(); $(toHide).hide();
$("body > main, body > main > article").has(toShow).show(); $("#editor").css({top: "-9999px"});
$(toShow).show(); $("body > main, body > main > article").has($toShow).show();
$toShow.show();
if (path == "editor") {
$toShow.css({top: 0});
}
window.location.hash = toShow; window.location.hash = toShow;
if ($("body > main > article").has(toShow).length == 0) { if ($("body > main > article").has(toShow).length == 0) {

View file

@ -2,6 +2,7 @@
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
top: -9999px;
} }
.scratch_unsupported p { .scratch_unsupported p {