From 1679756a8097b93a7ffe69e954dff76630a13bff Mon Sep 17 00:00:00 2001 From: Robert Swoboda <53216935+Gengar-i@users.noreply.github.com> Date: Mon, 10 Jul 2023 12:55:30 +0200 Subject: [PATCH] IBX-5784: CkEditor toolbar top position fixed (#92) --- .../public/js/CKEditor/core/base-ckeditor.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js index 2d8c82a6..51855fd2 100644 --- a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js +++ b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js @@ -34,11 +34,12 @@ const VIEWPORT_TOP_OFFSET = 102; (function (global, doc, ibexa) { class BaseRichText { - constructor() { + constructor(config) { this.ezNamespace = 'http://ibexa.co/namespaces/ezpublish5/xhtml5/edit'; this.xhtmlNamespace = 'http://www.w3.org/1999/xhtml'; this.editor = null; + this.viewportTopOffset = config?.viewportTopOffset ?? VIEWPORT_TOP_OFFSET; this.xhtmlify = this.xhtmlify.bind(this); this.getData = this.getData.bind(this); @@ -176,10 +177,10 @@ const VIEWPORT_TOP_OFFSET = 102; ], toolbar: { items: toolbar, - ui: { - viewportTopOffset: { - top: VIEWPORT_TOP_OFFSET, - }, + }, + ui: { + viewportOffset: { + top: this.viewportTopOffset, }, }, embedImage: {