Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 't/10832' into major
  • Loading branch information
oleq committed Oct 3, 2013
2 parents 0293957 + ed74483 commit 82f619a
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions plugins/image2/plugin.js
Expand Up @@ -212,16 +212,9 @@
height: image.getAttribute( 'height' ) || ''
};

// If element was marked as centered when upcasting, update
// the alignment both visually and in widget data.
if ( this.element.data( 'cke-centered' ) ) {
this.element.data( 'cke-centered', false );
data.align = 'center';
}

// Otherwise, read initial float style from figure/image and
// Read initial float style from figure/image and
// then remove it. This style will be set on wrapper in #data listener.
else {
if ( !data.align ) {
data.align = this.element.getStyle( 'float' ) || image.getStyle( 'float' ) || 'none';
this.element.removeStyle( 'float' );
image.removeStyle( 'float' );
Expand Down Expand Up @@ -434,7 +427,7 @@
// Creates widgets from all <img> and <figure class="caption">.
//
// @param {CKEDITOR.htmlParser.element} el
function upcastWidgetElement( el ) {
function upcastWidgetElement( el, data ) {
var dimensions = { width:1,height:1 },
name = el.name,
image;
Expand All @@ -453,9 +446,7 @@
el = figure;
}

// Mark the element as centered, so widget.data.align
// can be correctly filled on init.
el.attributes[ 'data-cke-centered' ] = true;
data.align = 'center';

image = el.getFirst( 'img' );
}
Expand Down

0 comments on commit 82f619a

Please sign in to comment.