better print questions function

This commit is contained in:
rofl256 2017-03-15 20:12:07 +01:00
parent 91c31a0b0b
commit 6818645273
2 changed files with 4 additions and 7 deletions

View File

@ -133,7 +133,6 @@
<div id="blackScreen" style="display:none; position:absolute; left:0px; top:0px; width:100%; height:100%; background:black;"></div>
</div>
<div id="printScreen" style="display:none; position:absolute; left:0px; top:0px; width:100%; height:100%; background:white;">
<i id="closePrintScreenIcon" style="position: fixed; right: 30px; top: 10px; font-size: 1.2em; cursor:pointer;" class="fa fa-caret-square-o-down"></i>
<div id="printDiv"></div>
</div>
</body>

View File

@ -9,16 +9,14 @@ var schweinchen = null;
$(document).ready(function() {
$( "#fragenListe" ).sortable();
$("#closePrintScreenIcon").click(function() {
$("#printScreen").hide();
$("#allContent").show();
});
$("#printQuestions").click(function() {
$("#printDiv").empty();
showQuestionsAsPrint();
$("#printScreen").show();
$("#allContent").hide();
window.print();
$("#printScreen").hide();
$("#allContent").show();
});
$("#blackScreenCheck").change(function() {
@ -126,7 +124,7 @@ $(document).ready(function() {
});
function showQuestionsAsPrint() {
var ges = '<ol>';
var ges = '<h2 style="margin-left:30px;">Familienduell Fragen</h2><ol>';
for(var i=0;i<fragen.length;i++) {
ges += '<li>'+fragen[i]["frage"]+'</li>';
}