Move print button to our toolbar

pull/1/head
yflory 5 years ago
parent 33db6e0ce2
commit c5893cd787

@ -36,6 +36,9 @@ body.cp-app-pad {
align-items: center; align-items: center;
padding: 4px; padding: 4px;
} }
.cke_button__print {
display: none !important;
}
} }
.cke_wysiwyg_frame { .cke_wysiwyg_frame {
width: 100%; width: 100%;

@ -456,6 +456,15 @@ define([
}); });
}; };
var mkPrintButton = function (framework, editor, ckeditor) {
var $printButton = framework._.sfCommon.createButton('print', true);
$printButton.click(function () {
editor.execCommand('print');
framework.feedback('PRINT_PAD');
});
framework._.toolbar.$drawer.append($printButton);
};
var andThen2 = function(editor, Ckeditor, framework) { var andThen2 = function(editor, Ckeditor, framework) {
var mediaTagMap = {}; var mediaTagMap = {};
var $contentContainer = $('#cke_1_contents'); var $contentContainer = $('#cke_1_contents');
@ -480,6 +489,8 @@ define([
framework._.sfCommon.addShortcuts(ifrWindow); framework._.sfCommon.addShortcuts(ifrWindow);
mkPrintButton(framework, editor, Ckeditor);
var documentBody = ifrWindow.document.body; var documentBody = ifrWindow.document.body;
var inner = window.inner = documentBody; var inner = window.inner = documentBody;
var $inner = $(inner); var $inner = $(inner);

Loading…
Cancel
Save