Skip to content

Commit

Permalink
Merge branch 't/12546'
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Jasiun committed Nov 3, 2014
2 parents 1cbc97a + 01b3c44 commit 6e948c2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -13,6 +13,7 @@ Fixed Issues:
* [#12489](http://dev.ckeditor.com/ticket/12423) and [#12491](http://dev.ckeditor.com/ticket/12423): Fixed: Various issues related to restoring selection after making operations on filler char. See the [fixed cases](http://dev.ckeditor.com/ticket/12491#comment:4).
* [#11647](http://dev.ckeditor.com/ticket/11647): Fixed: The [`editor.blur`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-blur) event is not fired on first blur after initializing the inline editor on already focused element.
* [#12601](http://dev.ckeditor.com/ticket/12601): Fixed: [Strikethrough](http://ckeditor.com/addon/basicstyles) button tooltip spelling.
* [#12546](http://dev.ckeditor.com/ticket/12546): Fixed: Preview tab in docprops dialog is always disabled.

## CKEditor 4.4.5

Expand Down
9 changes: 5 additions & 4 deletions plugins/docprops/dialogs/docprops.js
Expand Up @@ -583,22 +583,23 @@ CKEDITOR.dialog.add( 'docProps', function( editor ) {
{
type: 'html',
id: 'previewHtml',
html: '<iframe src="' + previewSrc + '" style="width: 100%; height: 310px" hidefocus="true" frameborder="0" ' +
'id="cke_docProps_preview_iframe"></iframe>',
html: '<iframe src="' + previewSrc + '" style="width: 100%; height: 310px" hidefocus="true" frameborder="0"></iframe>',
onLoad: function() {
var iframe = this.getElement();

this.getDialog().on( 'selectPage', function( ev ) {
if ( ev.data.page == 'preview' ) {
var self = this;
setTimeout( function() {
var doc = CKEDITOR.document.getById( 'cke_docProps_preview_iframe' ).getFrameDocument(),
var doc = iframe.getFrameDocument(),
html = doc.getElementsByTag( 'html' ).getItem( 0 ),
head = doc.getHead(),
body = doc.getBody();
self.commitContent( doc, html, head, body, 1 );
}, 50 );
}
} );
CKEDITOR.document.getById( 'cke_docProps_preview_iframe' ).getAscendant( 'table' ).setStyle( 'height', '100%' );
iframe.getAscendant( 'table' ).setStyle( 'height', '100%' );
}
}
]
Expand Down
13 changes: 13 additions & 0 deletions tests/plugins/docprops/docprops.js
Expand Up @@ -39,5 +39,18 @@ bender.test( {
} );

tc.wait();
},

// #12546
'test preview tab is available': function() {
var bot = this.editorBot;

bot.dialog( 'docProps', function( dialog ) {
var tabs = dialog.parts.tabs.getChildren();

assert.isTrue( !tabs.getItem( 3 ).hasClass( 'cke_dialog_tab_disabled' ), 'Tab preview should be enabled.' );

dialog.getButton( 'ok' ).click();
} );
}
} );

0 comments on commit 6e948c2

Please sign in to comment.