From 6176d73c86f9bc9cbeeac7c925fda5ec98d677a6 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 22 Jun 2020 16:53:31 +0200 Subject: [PATCH] Move print button to our toolbar --- www/pad/app-pad.less | 3 +++ www/pad/inner.js | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/www/pad/app-pad.less b/www/pad/app-pad.less index 103241a52..e3de1fcf0 100644 --- a/www/pad/app-pad.less +++ b/www/pad/app-pad.less @@ -36,6 +36,9 @@ body.cp-app-pad { align-items: center; padding: 4px; } + .cke_button__print { + display: none !important; + } } .cke_wysiwyg_frame { width: 100%; diff --git a/www/pad/inner.js b/www/pad/inner.js index 05cf2c788..84fd311f8 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -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 mediaTagMap = {}; var $contentContainer = $('#cke_1_contents'); @@ -480,6 +489,8 @@ define([ framework._.sfCommon.addShortcuts(ifrWindow); + mkPrintButton(framework, editor, Ckeditor); + var documentBody = ifrWindow.document.body; var inner = window.inner = documentBody; var $inner = $(inner);