Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-layout dialog after textarea is loaded to fix scroll behaviour #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions footnotes/dialogs/footnotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@
dialog.editor_name = evt.editor.name;
} );

// Allow page to scroll with dialog to allow for many/long footnotes
// (https://github.com/andykirk/CKEditorFootnotes/issues/12)
jQuery('.cke_dialog').css({'position': 'absolute', 'top': '2%'});

var current_editor_id = dialog.getParentEditor().id;

CKEDITOR.replaceAll( function( textarea, config ) {
Expand Down Expand Up @@ -129,6 +125,11 @@
config.removePlugins = 'footnotes';

config.on = {
// Re-layout dialog after textarea is loaded to fix scroll behaviour
// (https://github.com/andykirk/CKEditorFootnotes/issues/12)
instanceReady: function() {
dialog.layout();
},
focus: function( evt ){
var $editor_el = $('#' + evt.editor.id + '_contents');
$editor_el.parents('tr').next().find(':checked').attr('checked', false);
Expand Down