Skip to content

Commit

Permalink
Fix responsive images with alignment CKEDITOR - refs BT#13016
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Jul 17, 2017
1 parent 24c5ee4 commit 03d7489
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/Resources/public/css/editor.css
Expand Up @@ -234,7 +234,6 @@ blockquote p {
color: #843534;
}
.img-responsive {
display: block;
max-width: 100%;
height: auto;
}
Expand Down Expand Up @@ -262,3 +261,9 @@ blockquote p {
.img-va-text-bottom {
vertical-align: text-bottom;
}

@media (max-width: 767px) {
.img-responsive {
display: block;
}
}
Expand Up @@ -1028,6 +1028,18 @@

if ( align && align != 'none' ) {
var styles = CKEDITOR.tools.parseCssText( attrs.style || '' );
var allowedAllignments = {
'left': 1,
'right': 1,
'baseline': 1,
'top': 1,
'bottom': 1,
'middle': 1,
'super': 1,
'sub': 1,
'text-top': 1,
'text-bottom': 1
};

// When the widget is captioned (<figure>) and internally centering is done
// with widget's wrapper style/class, in the external data representation,
Expand All @@ -1047,7 +1059,7 @@
}

// If left/right, add float style to the downcasted element.
else if ( align in { left: 1, right: 1 } ) {
else if ( align in allowedAllignments ) {
if ( alignClasses )
attrsHolder.addClass( alignClasses[ alignmentsObj[ align ] ] );
else if (align == 'left' || align == 'right')
Expand Down

0 comments on commit 03d7489

Please sign in to comment.