Skip to content
This repository was archived by the owner on Jan 15, 2022. It is now read-only.

Commit 2a143da

Browse files
mohamedHedi1990Thomas Delhoménie
authored andcommitted
ECMS-7908: Insert image icon and link icon are not displayed in t… (#368)
1 parent f041129 commit 2a143da

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

extension/webapp/src/main/webapp/javascript/document-preview.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,7 @@
975975

976976
// TODO this line is mandatory when a custom skin is defined, it should not be mandatory
977977
CKEDITOR.basePath = '/commons-extension/ckeditor/';
978+
var toolbarHeight = 39;
978979
commentInput.ckeditor({
979980
customConfig: '/commons-extension/ckeditorCustom/config.js',
980981
extraPlugins: extraPlugins,
@@ -996,12 +997,16 @@
996997
var contentHeight = $content.height();
997998
var $ckeBottom = $('#' + evt.editor.id + '_bottom');
998999
$ckeBottom[0].style.display = "block";
1000+
var originalHeight = $ckeBottom.css('height', 'auto').outerHeight();
1001+
toolbarHeight = $ckeBottom.addClass('cke_bottom_visible').outerHeight();
1002+
var heightToAddVisibleClass = toolbarHeight - originalHeight;
1003+
$ckeBottom.removeClass('cke_bottom_visible').css('height', '0px');
9991004
$ckeBottom.animate({
1000-
height: "39"
1005+
height: "" + toolbarHeight
10011006
}, {
10021007
step: function(number, tween) {
10031008
$content.height(contentHeight - number);
1004-
if (number >= 9) {
1009+
if (number >= heightToAddVisibleClass) {
10051010
$ckeBottom.addClass('cke_bottom_visible');
10061011
}
10071012
}
@@ -1014,7 +1019,7 @@
10141019
blur : function ( evt ) {
10151020
// Hide the editor toolbar
10161021
if ($(window).width() > 767 || $(window).width() < $(window).height()) {
1017-
$('#' + evt.editor.id + '_contents').css('height', $('#' + evt.editor.id + '_contents').height() + 39);
1022+
$('#' + evt.editor.id + '_contents').css('height', $('#' + evt.editor.id + '_contents').height() + toolbarHeight);
10181023
$('#' + evt.editor.id + '_bottom').css('height', '0px');
10191024
$('#' + evt.editor.id + '_bottom').removeClass('cke_bottom_visible');
10201025
}

0 commit comments

Comments
 (0)