Skip to content

Commit

Permalink
Add helper function to convert CSS unit to px.
Browse files Browse the repository at this point in the history
  • Loading branch information
hub33k committed May 12, 2020
1 parent bc7ef1b commit 8ec41cb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/creators/themedui.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,15 @@ CKEDITOR.replaceClass = 'ckeditor';
outer = container;
}

if ( typeof width == 'string' ) {
width = CKEDITOR.tools.convertToPx( width );
}
width = convertCssUnitToPx( width );

// Set as border box width. (https://dev.ckeditor.com/ticket/5353)
outer.setSize( 'width', width, true );

// WebKit needs to refresh the iframe size to avoid rendering issues. (1/2) (https://dev.ckeditor.com/ticket/8348)
contentsFrame && ( contentsFrame.style.width = '1%' );

if ( typeof height == 'string' ) {
height = CKEDITOR.tools.convertToPx( height );
}
height = convertCssUnitToPx( height );

// Get the height delta between the outer table and the content area.
var contentsOuterDelta = ( outer.$.offsetHeight || 0 ) - ( contents.$.clientHeight || 0 ),
Expand Down Expand Up @@ -334,6 +330,10 @@ CKEDITOR.replaceClass = 'ckeditor';
return forContents ? this.ui.space( 'contents' ) : this.container;
};

function convertCssUnitToPx( unit ) {
return CKEDITOR.tools.convertToPx( CKEDITOR.tools.cssLength( unit ) );
}

function createInstance( element, config, data, mode ) {
element = CKEDITOR.editor._getEditorElement( element );

Expand Down

0 comments on commit 8ec41cb

Please sign in to comment.