mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
TinyMCE: wpView improvements: introduce getText() and remove() methods, improved getInstance(), better docs. Props iseulde. See #31412.
git-svn-id: https://develop.svn.wordpress.org/trunk@31559 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -72,11 +72,9 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||
}
|
||||
|
||||
function removeView( view ) {
|
||||
// TODO: trigger an event to run a clean up function.
|
||||
// Maybe `jQuery( view ).trigger( 'remove' );`?
|
||||
editor.undoManager.transact( function() {
|
||||
handleEnter( view );
|
||||
editor.dom.remove( view );
|
||||
wp.mce.views.remove( editor, view );
|
||||
});
|
||||
}
|
||||
|
||||
@@ -107,7 +105,7 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||
clipboard = dom.create( 'div', {
|
||||
'class': 'wpview-clipboard',
|
||||
'contenteditable': 'true'
|
||||
}, decodeURIComponent( editor.dom.getAttrib( viewNode, 'data-wpview-text' ) ) );
|
||||
}, wp.mce.views.getText( viewNode ) );
|
||||
|
||||
editor.dom.select( '.wpview-body', viewNode )[0].appendChild( clipboard );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user