TinyMCE in iOS:
- Fix placing the caret at the bottom of longer posts when the keyboard is open. - Disable resizing on switching editors and on show/hide the kitchen sink row. See #28242 git-svn-id: https://develop.svn.wordpress.org/trunk@28626 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7f49c1320a
commit
d87a482353
@ -60,7 +60,8 @@ window.switchEditors = {
|
||||
if ( ed ) {
|
||||
ed.show();
|
||||
|
||||
if ( editorHeight ) {
|
||||
// No point resizing the iframe in iOS
|
||||
if ( ! tinymce.Env.iOS && editorHeight ) {
|
||||
toolbarHeight = getToolbarHeight();
|
||||
editorHeight = editorHeight - toolbarHeight + 14;
|
||||
|
||||
@ -84,16 +85,18 @@ window.switchEditors = {
|
||||
}
|
||||
|
||||
if ( ed ) {
|
||||
iframe = DOM.get( id + '_ifr' );
|
||||
editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0;
|
||||
if ( ! tinymce.Env.iOS ) {
|
||||
iframe = DOM.get( id + '_ifr' );
|
||||
editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0;
|
||||
|
||||
if ( editorHeight ) {
|
||||
toolbarHeight = getToolbarHeight();
|
||||
editorHeight = editorHeight + toolbarHeight - 14;
|
||||
if ( editorHeight ) {
|
||||
toolbarHeight = getToolbarHeight();
|
||||
editorHeight = editorHeight + toolbarHeight - 14;
|
||||
|
||||
// height cannot be under 50 or over 5000
|
||||
if ( editorHeight > 50 && editorHeight < 5000 ) {
|
||||
txtarea_el.style.height = editorHeight + 'px';
|
||||
// height cannot be under 50 or over 5000
|
||||
if ( editorHeight > 50 && editorHeight < 5000 ) {
|
||||
txtarea_el.style.height = editorHeight + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,9 +37,12 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
}
|
||||
});
|
||||
|
||||
if ( pixels && ! initial ) {
|
||||
iframe = editor.getContentAreaContainer().firstChild;
|
||||
DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels ); // Resize iframe
|
||||
if ( pixels && ! initial ) {
|
||||
// Resize iframe, not needed in iOS
|
||||
if ( ! tinymce.Env.iOS ) {
|
||||
iframe = editor.getContentAreaContainer().firstChild;
|
||||
DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels );
|
||||
}
|
||||
|
||||
if ( state === 'hide' ) {
|
||||
setUserSetting('hidetb', '0');
|
||||
@ -277,6 +280,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
doc = editor.getDoc(),
|
||||
dom = editor.dom;
|
||||
|
||||
if ( tinymce.Env.iOS ) {
|
||||
dom.addClass( doc.documentElement, 'ios' );
|
||||
}
|
||||
|
||||
if ( editor.getParam( 'directionality' ) === 'rtl' ) {
|
||||
bodyClass.push('rtl');
|
||||
dom.setAttrib( doc.documentElement, 'dir', 'rtl' );
|
||||
@ -358,6 +365,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
editor.on( 'preInit', function() {
|
||||
// Don't replace <i> with <em> and <b> with <strong> and don't remove them when empty
|
||||
editor.schema.addValidElements( '@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b' );
|
||||
|
||||
if ( tinymce.Env.iOS ) {
|
||||
editor.settings.height = 300;
|
||||
}
|
||||
});
|
||||
|
||||
// Add custom shortcuts
|
||||
|
@ -1,4 +1,14 @@
|
||||
/* Additional default styles for the editor */
|
||||
|
||||
html.ios {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ios body#tinymce {
|
||||
height: 200%;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
font-size: 13px;
|
||||
|
Loading…
Reference in New Issue
Block a user