Supprimer les espaces

This commit is contained in:
Fred Tempez 2020-06-12 17:15:55 +02:00
parent 4ed4a4e0d9
commit 9227fe5e3c
1 changed files with 23 additions and 21 deletions

View File

@ -35,7 +35,7 @@ tinymce.init({
saveCursorPosition: false, // Insert caret marker
config: { // CodeMirror config object
/*theme: 'ambiance',*/
fullscreen: true,
fullscreen: true,
/*mode: 'application/x-httpd-php',*/
indentUnit: 4,
lineNumbers: true,
@ -53,10 +53,10 @@ tinymce.init({
],
cssFiles: [
/*'theme/ambiance.css',*/
],
],
width: 800, // Default value is 800
height: 500 // Default value is 550
},
height: 500 // Default value is 550
},
// Cibles de la target
target_list: [
{title: 'None', value: ''},
@ -67,7 +67,7 @@ tinymce.init({
{title: 'None', value: ''},
{title: 'Une popup (Lity)', value: 'data-lity'},
{title: 'Une galerie d\'images (SimpleLightbox)', value: 'gallery'}
],
],
// Titre des image
image_title: true,
// Pages internes
@ -86,11 +86,13 @@ tinymce.init({
// Cache les menus
menubar: true,
// URL menu contextuel
link_context_toolbar: true,
link_context_toolbar: true,
// Cache la barre de statut
statusbar: false,
// Active le copié collé à partir du Web
paste_data_images: true,
// Active le copié collé à partir du presse papier
paste_filter_drop: false,
/* Eviter BLOB à tester
images_dataimg_filter: function(img) {
return img.hasAttribute('internal-blob');
@ -208,7 +210,7 @@ tinymce.PluginManager.add('stickytoolbar', function(editor, url) {
editor.on('init', function() {
setSticky();
});
$(window).on('scroll', function() {
setSticky();
});
@ -218,12 +220,12 @@ tinymce.PluginManager.add('stickytoolbar', function(editor, url) {
var toolbars = $(container).find('.mce-toolbar-grp');
var statusbar = $(container).find('.mce-statusbar');
var menubar = $(container).find('.mce-menubar');
if (isSticky()) {
$(container).css({
paddingTop: menubar.outerHeight()
});
if (isAtBottom()) {
toolbars.css({
top: 'auto',
@ -231,7 +233,7 @@ tinymce.PluginManager.add('stickytoolbar', function(editor, url) {
position: 'absolute',
width: '100%',
borderBottom: 'none'
});
});
} else {
menubar.css({
top: 45,
@ -240,20 +242,20 @@ tinymce.PluginManager.add('stickytoolbar', function(editor, url) {
width: $(container).width(),
borderBottom: '1px solid rgba(0,0,0,0.2)',
background: '#fff'
});
});
toolbars.css({
top: 78,
bottom: 'auto',
position: 'fixed',
width: $(container).width(),
borderBottom: '1px solid rgba(0,0,0,0.2)'
});
});
}
} else {
$(container).css({
paddingTop: 0
});
toolbars.css({
top:0,
position: 'relative',
@ -265,34 +267,34 @@ tinymce.PluginManager.add('stickytoolbar', function(editor, url) {
position: 'relative',
width: 'auto',
borderBottom: 'none'
});
});
}
}
function isSticky() {
var container = editor.editorContainer,
editorTop = container.getBoundingClientRect().top;
if (editorTop < 0) {
return true;
}
return false;
}
function isAtBottom() {
var container = editor.editorContainer,
editorTop = container.getBoundingClientRect().top;
var toolbarHeight = $(container).find('.mce-toolbar-grp').outerHeight();
var footerHeight = $(container).find('.mce-statusbar').outerHeight();
var hiddenHeight = -($(container).outerHeight() - toolbarHeight - footerHeight);
if (editorTop < hiddenHeight) {
return true;
}
return false;
}
});