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.

git-svn-id: https://develop.svn.wordpress.org/trunk@37630 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2016-06-02 23:57:32 +00:00
parent 6792df6fab
commit 7d82fb2ee0
2 changed files with 5 additions and 2 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;
}

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() ) {