TinyMCE, inline link:
- Make sure the inline dialog is not showing under the advanced modal. - Fix checking if the link node contains text. - Fix undo levels so all actions can be undone and redone. See #33301. Built from https://develop.svn.wordpress.org/trunk@36716 git-svn-id: http://core.svn.wordpress.org/trunk@36683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -885,7 +885,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
|
||||
function hide( event ) {
|
||||
if ( activeToolbar ) {
|
||||
if ( event.type === 'hide' ) {
|
||||
if ( activeToolbar.tempHide || event.type === 'hide' ) {
|
||||
activeToolbar.hide();
|
||||
activeToolbar = false;
|
||||
} else if ( ( event.type === 'resize' || event.type === 'scroll' ) && ! activeToolbar.blockHide ) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -223,13 +223,17 @@
|
||||
} );
|
||||
|
||||
editor.addCommand( 'wp_link_cancel', function() {
|
||||
inputInstance.reset();
|
||||
removePlaceholders();
|
||||
editor.focus();
|
||||
|
||||
if ( tinymce.isIE ) {
|
||||
editor.selection.moveToBookmark( editor.windowManager.wplinkBookmark );
|
||||
editor.windowManager.wplinkBookmark = null;
|
||||
if ( ! editToolbar.tempHide ) {
|
||||
inputInstance.reset();
|
||||
removePlaceholders();
|
||||
editor.focus();
|
||||
|
||||
if ( tinymce.isIE ) {
|
||||
editor.selection.moveToBookmark( editor.windowManager.wplinkBookmark );
|
||||
editor.windowManager.wplinkBookmark = null;
|
||||
}
|
||||
|
||||
editToolbar.tempHide = false;
|
||||
}
|
||||
} );
|
||||
|
||||
@@ -285,8 +289,10 @@
|
||||
|
||||
// Prevent adding undo levels on inserting link placeholder.
|
||||
editor.on( 'BeforeAddUndo', function( event ) {
|
||||
if ( event.level.content ) {
|
||||
event.level.content = removePlaceholderStrings( event.level.content );
|
||||
if ( event.lastLevel && event.lastLevel.content && event.level.content &&
|
||||
event.lastLevel.content === removePlaceholderStrings( event.level.content ) ) {
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -388,9 +394,12 @@
|
||||
$linkNode, href, edit;
|
||||
|
||||
if ( tinymce.$( document.body ).hasClass( 'modal-open' ) ) {
|
||||
editToolbar.tempHide = true;
|
||||
return;
|
||||
}
|
||||
|
||||
editToolbar.tempHide = false;
|
||||
|
||||
if ( linkNode ) {
|
||||
$linkNode = editor.$( linkNode );
|
||||
href = $linkNode.attr( 'href' );
|
||||
@@ -432,8 +441,10 @@
|
||||
var url = inputInstance.getURL() || null,
|
||||
text = inputInstance.getLinkText() || null;
|
||||
|
||||
editor.focus();
|
||||
editor.focus(); // Needed for IE
|
||||
window.wpLink.open( editor.id, url, text );
|
||||
|
||||
editToolbar.tempHide = true;
|
||||
inputInstance.reset();
|
||||
}
|
||||
}
|
||||
@@ -447,8 +458,9 @@
|
||||
} );
|
||||
|
||||
return {
|
||||
hideEditToolbar: function() {
|
||||
editToolbar.hide();
|
||||
close: function() {
|
||||
editToolbar.tempHide = false;
|
||||
editor.execCommand( 'wp_link_cancel' );
|
||||
}
|
||||
};
|
||||
} );
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user