Skip to content

Commit

Permalink
Remoe widget container after last foottote removed
Browse files Browse the repository at this point in the history
Fixes #7
  • Loading branch information
andykirk committed Sep 29, 2014
1 parent 4258dac commit 9caa039
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions footnotes/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ CKEDITOR.plugins.add( 'footnotes', {
$footnotes = $contents.find('.footnotes');

if ($footnotes.length == 0) {
var container = '<section class="footnotes"><header><h2>Footnotes</h2></header><ol>' + footnote + '</ol></section>';
var container = '<section class="footnotes"><header><h2>Footnotes</h2></header><ol>' + footnote + '</ol></section>&nbsp;';
// Move cursor to end of content:
var range = editor.createRange();
range.moveToElementEditEnd(range.root);
Expand Down Expand Up @@ -220,7 +220,7 @@ CKEDITOR.plugins.add( 'footnotes', {
var $markers = $contents.find('sup[data-footnote-id]');
// If there aren't any, remove the Footnotes container:
if ($markers.length == 0) {
$contents.find('.footnotes').remove();
$contents.find('.footnotes').parent().remove();
editor.fire('unlockSnapshot');
return;
}
Expand Down

1 comment on commit 9caa039

@andykirk
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgive stupid typos in commit message!

Please sign in to comment.