|
975 | 975 |
|
976 | 976 | // TODO this line is mandatory when a custom skin is defined, it should not be mandatory |
977 | 977 | CKEDITOR.basePath = '/commons-extension/ckeditor/'; |
| 978 | + var toolbarHeight = 39; |
978 | 979 | commentInput.ckeditor({ |
979 | 980 | customConfig: '/commons-extension/ckeditorCustom/config.js', |
980 | 981 | extraPlugins: extraPlugins, |
|
996 | 997 | var contentHeight = $content.height(); |
997 | 998 | var $ckeBottom = $('#' + evt.editor.id + '_bottom'); |
998 | 999 | $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'); |
999 | 1004 | $ckeBottom.animate({ |
1000 | | - height: "39" |
| 1005 | + height: "" + toolbarHeight |
1001 | 1006 | }, { |
1002 | 1007 | step: function(number, tween) { |
1003 | 1008 | $content.height(contentHeight - number); |
1004 | | - if (number >= 9) { |
| 1009 | + if (number >= heightToAddVisibleClass) { |
1005 | 1010 | $ckeBottom.addClass('cke_bottom_visible'); |
1006 | 1011 | } |
1007 | 1012 | } |
|
1014 | 1019 | blur : function ( evt ) { |
1015 | 1020 | // Hide the editor toolbar |
1016 | 1021 | 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); |
1018 | 1023 | $('#' + evt.editor.id + '_bottom').css('height', '0px'); |
1019 | 1024 | $('#' + evt.editor.id + '_bottom').removeClass('cke_bottom_visible'); |
1020 | 1025 | } |
|
0 commit comments