Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the switch button by a radio button with three states off/solo/on #123

Open
wants to merge 5 commits into
base: preview-management-url
Choose a base branch
from
Prev Previous commit
Next Next commit
Use the new paysageRendere URL for the programmer preview management.
  • Loading branch information
etienneCharignon committed Sep 26, 2018
commit e394e6f965b264d6aa2a9220b11b961d67b799ae
14 changes: 6 additions & 8 deletions public/programmerjs/previewmanagement.js
Original file line number Diff line number Diff line change
@@ -3,20 +3,18 @@
(function () {
'use strict';

var frozenpreview = null;
var previewIsOn = true;

function switchframe (event) {
event.preventDefault();
if (frozenpreview) {
frozenpreview.appendTo('#viewercontainer');
frozenpreview = null;
$('#viewercontainer').show();
if (previewIsOn) {
previewIsOn = false;
$('#previewisoff').hide();
$('#previewison').show();
$('#viewerframe').attr('src', '/playground/' + $('#playgroundid').val() + '#only=');
} else {
$('#viewercontainer').hide(1, function () {
frozenpreview = $('#viewerframe').detach();
});
previewIsOn = true;
$('#viewerframe').attr('src', '/playground/' + $('#playgroundid').val() + '#');
$('#previewison').hide();
$('#previewisoff').show();
}