Fix UI issues when printing code

This commit is contained in:
yflory 2020-10-26 14:57:54 +01:00
parent f7bd3bdc23
commit d25d9c4f83
8 changed files with 24 additions and 6 deletions

View File

@ -9,10 +9,6 @@
max-height: none;
overflow: visible;
display: block;
@page {
margin: 0;
size: landscape;
}
// Slide app
body.cp-app-slide {
display: block;
@ -48,11 +44,15 @@
// Code app
body.cp-app-code {
display: block;
height: auto;
* {
visibility: hidden;
height: auto;
max-height: none;
}
.cp-toolbar-userlist-drawer {
display: none;
}
#cme_toolbox {
display: none;
}
@ -64,6 +64,7 @@
#cp-app-code-preview {
display: block;
#cp-app-code-print {
font-size: 20px;
display: block;
overflow: visible !important;
width: 100%;

View File

@ -0,0 +1,5 @@
@page {
margin: 0;
size: A4 landscape;
}

View File

@ -0,0 +1,4 @@
@page {
margin: 3cm;
size: A4 portrait;
}

View File

@ -136,7 +136,6 @@
#cp-app-code-print {
position: relative;
display: none;
margin: 50px;
.markdown_preformatted-code;
.markdown_gfm-table(black);
}

View File

@ -42,6 +42,7 @@ define([
'cm/addon/fold/comment-fold',
'cm/addon/display/placeholder',
'css!/customize/src/print.css',
'less!/code/app-code.less'
], function (

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="cp-app-noscroll">
<html class="cp-app-noscroll cp-app-print">
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<script async data-bootload="/pad/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>

View File

@ -47,6 +47,7 @@ define([
'/bower_components/diff-dom/diffDOM.js',
'css!/customize/src/print.css',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
'less!/pad/app-pad.less'
@ -500,6 +501,12 @@ define([
var mkPrintButton = function (framework, editor) {
var $printButton = framework._.sfCommon.createButton('print', true);
$printButton.click(function () {
/*
// NOTE: alternative print system in case we keep having more issues on Firefox
var $iframe = $('html').find('iframe');
var iframe = $iframe[0].contentWindow;
iframe.print();
*/
editor.execCommand('print');
framework.feedback('PRINT_PAD');
});

View File

@ -15,6 +15,7 @@ define([
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
'css!/customize/src/print-landscape.css',
'less!/slide/app-slide.less',
'css!cm/lib/codemirror.css',