WordPress.org

Make WordPress Core

Changeset 37630


Ignore:
Timestamp:
06/02/2016 11:57:32 PM (4 years ago)
Author:
azaozz
Message:

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.

Location:
trunk/src/wp-includes/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js

    r37301 r37630  
    159159
    160160                editToolbar.on( 'show', function() {
    161                     if ( ! tinymce.$( document.body ).hasClass( 'modal-open' ) ) {
     161                    if ( typeof window.wpLink === 'undefiend' || ! window.wpLink.modalOpen ) {
    162162                        window.setTimeout( function() {
    163163                            var element = editToolbar.$el.find( 'input.ui-autocomplete-input' )[0],
     
    476476                $linkNode, href, edit;
    477477
    478             if ( tinymce.$( document.body ).hasClass( 'modal-open' ) ) {
     478            if ( typeof window.wpLink !== 'undefiend' && window.wpLink.modalOpen ) {
    479479                editToolbar.tempHide = true;
    480480                return;
  • trunk/src/wp-includes/js/wplink.js

    r37621 r37630  
    2020        lastSearch: '',
    2121        textarea: '',
     22        modalOpen: false,
    2223
    2324        init: function() {
     
    9899
    99100            $body.addClass( 'modal-open' );
     101            wpLink.modalOpen = true;
    100102            linkNode = node;
    101103
     
    275277        close: function( reset ) {
    276278            $( document.body ).removeClass( 'modal-open' );
     279            wpLink.modalOpen = false;
    277280
    278281            if ( reset !== 'noReset' ) {
Note: See TracChangeset for help on using the changeset viewer.