Skip to content

Commit

Permalink
Issue backdrop#101: Minor fixing to removing classes. Adding default …
Browse files Browse the repository at this point in the history
…margins to floated images.
  • Loading branch information
quicksketch committed Aug 4, 2015
1 parent 339cbbe commit db0dfd3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ ol, ul, dl {
p.align-center {
text-align: center;
}
span.align-left,
img.align-left {
margin-right: 2em;
margin-bottom: 1em;
}
span.align-right,
img.align-right {
margin-left: 2em;
margin-bottom: 1em;
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ CKEDITOR.plugins.add('backdropimagecaption', {
// CKEditor seems to apply the caption class to downcast elements, which
// we do not want. Make sure that the caption class doesn't end up in
// the raw source.
img.removeClass(editor.config.image2_captionedClass);
var classes = editor.config.image2_captionedClass.split(' ');
for (var i = 0; i < classes.length; i++) {
element.removeClass(classes[i]);
}

return img;
};
Expand All @@ -107,7 +110,10 @@ CKEDITOR.plugins.add('backdropimagecaption', {
}

// Remove any caption classes from the raw element itself.
element.removeClass(editor.config.image2_captionedClass);
var classes = editor.config.image2_captionedClass.split(' ');
for (var i = 0; i < classes.length; i++) {
element.removeClass(classes[i]);
}

var attrs = element.attributes;
var retElement = element;
Expand Down

0 comments on commit db0dfd3

Please sign in to comment.