TinyMCE: attempt a workaround for WebKit bug inserting spans with font styles when creating UL or OL. See #17154
git-svn-id: https://develop.svn.wordpress.org/trunk@24211 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
40ba7996f8
commit
f4b1c3c53f
|
@ -7,7 +7,7 @@
|
|||
|
||||
tinymce.create('tinymce.plugins.WordPress', {
|
||||
init : function(ed, url) {
|
||||
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key;
|
||||
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key, style;
|
||||
moreHTML = '<img src="' + url + '/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
|
||||
nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
|
||||
|
||||
|
@ -133,6 +133,18 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( tinymce.isWebKit && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) ) {
|
||||
if ( !style )
|
||||
style = ed.dom.create('style', {'type': 'text/css'}, '#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}');
|
||||
|
||||
ed.getDoc().head.appendChild( style );
|
||||
}
|
||||
});
|
||||
|
||||
ed.onExecCommand.add( function( ed, cmd, ui, val ) {
|
||||
if ( tinymce.isWebKit && style && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) )
|
||||
ed.dom.remove( style );
|
||||
});
|
||||
|
||||
ed.onInit.add(function(ed) {
|
||||
|
|
|
@ -45,16 +45,6 @@ body {
|
|||
margin: 10px;
|
||||
}
|
||||
|
||||
br[data-mce-bogus] {
|
||||
line-height: 1em;
|
||||
margin-top: -1em;
|
||||
}
|
||||
|
||||
br[data-mce-bogus]:only-child {
|
||||
line-height: inherit;
|
||||
margin-top: inherit;
|
||||
}
|
||||
|
||||
.aligncenter,
|
||||
dl.aligncenter {
|
||||
display: block;
|
||||
|
|
Loading…
Reference in New Issue