diff --git a/src/assets/base.js b/src/assets/base.js index a717c00..a717efc 100644 --- a/src/assets/base.js +++ b/src/assets/base.js @@ -56,22 +56,23 @@ var today_pretty = new Date().toDateString(); var mywindow = window.open("", "new div", "height=800,width=800"); - mywindow.document.write("Sermon Notes"); + var mywindowHTML = "Sermon Notes"; /* optional stylesheet */ - mywindow.document.write( - '' - ); - mywindow.document.write( - '
' - ); - mywindow.document.write("

" + title + "

"); - mywindow.document.write("

" + today_pretty + "


"); - mywindow.document.write($(notes_text).html()); - mywindow.document.write("
"); + mywindowHTML += ''; + mywindowHTML += '
'; + mywindowHTML += "

" + title + "

"; + mywindowHTML += "

" + today_pretty + "


"; + mywindowHTML += $(notes_text).html(); + mywindowHTML += "
"; + + mywindow.document.body.innerHTML = mywindowHTML; + setTimeout(function() { mywindow.print(); - mywindow.close(); - }, 50); + setTimeout(function() { + mywindow.close(); + }, 1000); + }, 500); return true; }