Editor: do not use the `modal-open` class to determine when the wpLink modal is open. This is a class used in Bootstrap and may be present when wpLink is not open. Store the open/closed state instead.

Fixes #36662.
Built from https://develop.svn.wordpress.org/trunk@37630


git-svn-id: http://core.svn.wordpress.org/trunk@37598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2016-06-02 23:58:28 +00:00
parent 2211c28a37
commit 5e5aa1a69a
6 changed files with 8 additions and 5 deletions

View File

@ -158,7 +158,7 @@
editToolbar = editor.wp._createToolbar( editButtons, true );
editToolbar.on( 'show', function() {
if ( ! tinymce.$( document.body ).hasClass( 'modal-open' ) ) {
if ( typeof window.wpLink === 'undefiend' || ! window.wpLink.modalOpen ) {
window.setTimeout( function() {
var element = editToolbar.$el.find( 'input.ui-autocomplete-input' )[0],
selection = linkNode && ( linkNode.textContent || linkNode.innerText );
@ -475,7 +475,7 @@
var linkNode = editor.dom.getParent( event.element, 'a' ),
$linkNode, href, edit;
if ( tinymce.$( document.body ).hasClass( 'modal-open' ) ) {
if ( typeof window.wpLink !== 'undefiend' && window.wpLink.modalOpen ) {
editToolbar.tempHide = true;
return;
}

File diff suppressed because one or more lines are too long

View File

@ -19,6 +19,7 @@ var wpLink;
keySensitivity: 100,
lastSearch: '',
textarea: '',
modalOpen: false,
init: function() {
inputs.wrap = $('#wp-link-wrap');
@ -97,6 +98,7 @@ var wpLink;
$body = $( document.body );
$body.addClass( 'modal-open' );
wpLink.modalOpen = true;
linkNode = node;
wpLink.range = null;
@ -274,6 +276,7 @@ var wpLink;
close: function( reset ) {
$( document.body ).removeClass( 'modal-open' );
wpLink.modalOpen = false;
if ( reset !== 'noReset' ) {
if ( ! wpLink.isMCE() ) {

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37629';
$wp_version = '4.6-alpha-37630';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.