]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/wp-auth-check.js
Wordpress 4.5.3-scripts
[autoinstalls/wordpress.git] / wp-includes / js / wp-auth-check.js
index e58a27dab9c50338ad36cec14f99afe2bf42761e..9448a47ec7f722c1e53a321bbf530adccdcee7cc 100644 (file)
                        });
 
                        frame = $('<iframe id="wp-auth-check-frame" frameborder="0">').attr( 'title', noframe.text() );
-                       frame.load( function() {
+                       frame.on( 'load', function() {
                                var height, body;
 
                                loaded = true;
+                               // Remove the spinner to avoid unnecessary CPU/GPU usage.
+                               form.removeClass( 'loading' );
 
                                try {
                                        body = $(this).contents().find('body');
                                }
                        }).attr( 'src', form.data('src') );
 
-                       $('#wp-auth-check-form').append( frame );
+                       form.append( frame );
                }
 
+               $( 'body' ).addClass( 'modal-open' );
                wrap.removeClass('hidden');
 
                if ( frame ) {
                if ( typeof adminpage !== 'undefined' && ( adminpage === 'post-php' || adminpage === 'post-new-php' ) &&
                        typeof wp !== 'undefined' && wp.heartbeat ) {
 
+                       $(document).off( 'heartbeat-tick.wp-auth-check' );
                        wp.heartbeat.connectNow();
                }
 
                wrap.fadeOut( 200, function() {
                        wrap.addClass('hidden').css('display', '');
                        $('#wp-auth-check-frame').remove();
+                       $( 'body' ).removeClass( 'modal-open' );
                });
        }