mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-02 09:07:59 +02:00
TinyMCE: place the caret after/under images with captions when inserting content, fixes #19389
git-svn-id: http://core.svn.wordpress.org/trunk@22644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
65c026bcc3
commit
f630e12290
@ -102,6 +102,23 @@
|
||||
ed.wpGetImgCaption = function(content) {
|
||||
return t._get_shcode(content);
|
||||
};
|
||||
|
||||
// When inserting content, if the caret is inside a caption create new paragraph under
|
||||
// and move the caret there
|
||||
ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
|
||||
var node, p;
|
||||
|
||||
if ( cmd == 'mceInsertContent' ) {
|
||||
node = ed.dom.getParent(ed.selection.getNode(), 'div.mceTemp');
|
||||
|
||||
if ( !node )
|
||||
return;
|
||||
|
||||
p = ed.dom.create('p');
|
||||
ed.dom.insertAfter( p, node );
|
||||
ed.selection.setCursorLocation(p, 0);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_do_shcode : function(content) {
|
||||
|
Loading…
Reference in New Issue
Block a user