[9.2.26] Tinymce : menu sticky

This commit is contained in:
Fred Tempez 2020-03-22 15:29:15 +01:00
parent c16a5bfac1
commit 9666e482e8
1 changed files with 25 additions and 10 deletions

View File

@ -20,7 +20,7 @@ tinymce.init({
// Plugins // Plugins
plugins: "advlist anchor autolink autoresize autosave codemirror colorpicker contextmenu fullscreen hr image imagetools link lists media paste searchreplace stickytoolbar tabfocus table template textcolor codesample", plugins: "advlist anchor autolink autoresize autosave codemirror colorpicker contextmenu fullscreen hr image imagetools link lists media paste searchreplace stickytoolbar tabfocus table template textcolor codesample",
// Contenu de la barre d'outils // Contenu de la barre d'outils
toolbar: "restoredraft | undo redo | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | template code | image media link | fullscreen", toolbar: "restoredraft | undo redo | formatselect bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | table template code | image media link | fullscreen",
// CodeMirror // CodeMirror
codemirror: { codemirror: {
indentOnInit: true, // Whether or not to indent code on init. indentOnInit: true, // Whether or not to indent code on init.
@ -66,7 +66,7 @@ tinymce.init({
// Pages internes // Pages internes
link_list: baseUrl + "core/vendor/tinymce/links.php", link_list: baseUrl + "core/vendor/tinymce/links.php",
// Contenu du menu contextuel // Contenu du menu contextuel
contextmenu: "selectall searchreplace | hr | media image link anchor | inserttable cell row column deletetable", contextmenu: "selectall searchreplace | hr | media image link anchor | insertable cell row column deletetable",
// Fichiers CSS à intégrer à l'éditeur // Fichiers CSS à intégrer à l'éditeur
content_css: [ content_css: [
baseUrl + "core/layout/common.css", baseUrl + "core/layout/common.css",
@ -204,10 +204,11 @@ tinymce.PluginManager.add('stickytoolbar', function(editor, url) {
var container = editor.editorContainer; var container = editor.editorContainer;
var toolbars = $(container).find('.mce-toolbar-grp'); var toolbars = $(container).find('.mce-toolbar-grp');
var statusbar = $(container).find('.mce-statusbar'); var statusbar = $(container).find('.mce-statusbar');
var menubar = $(container).find('.mce-menubar');
if (isSticky()) { if (isSticky()) {
$(container).css({ $(container).css({
paddingTop: toolbars.outerHeight() paddingTop: menubar.outerHeight()
}); });
if (isAtBottom()) { if (isAtBottom()) {
@ -219,13 +220,21 @@ tinymce.PluginManager.add('stickytoolbar', function(editor, url) {
borderBottom: 'none' borderBottom: 'none'
}); });
} else { } else {
toolbars.css({ menubar.css({
top: 45, top: 45,
bottom: 'auto', bottom: 'auto',
position: 'fixed', position: 'fixed',
width: $(container).width(), width: $(container).width(),
borderBottom: '1px solid rgba(0,0,0,0.2)' 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 { } else {
$(container).css({ $(container).css({
@ -238,6 +247,12 @@ tinymce.PluginManager.add('stickytoolbar', function(editor, url) {
width: 'auto', width: 'auto',
borderBottom: 'none' borderBottom: 'none'
}); });
menubar.css({
top:0,
position: 'relative',
width: 'auto',
borderBottom: 'none'
});
} }
} }