Shiny Updates: Disable body scrolling when filesystem request modal is open.

props ericlewis.
fixes #31607.

git-svn-id: https://develop.svn.wordpress.org/trunk@31753 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-03-12 14:56:34 +00:00
parent fa3131ee02
commit a2abc13285
1 changed files with 5 additions and 3 deletions

View File

@ -386,14 +386,15 @@ window.wp = window.wp || {};
wp.updates.requestFilesystemCredentials = function() {
if ( wp.updates.updateDoneSuccessfully === false ) {
wp.updates.updateLock = true;
$('#request-filesystem-credentials-dialog').show();
$( 'body' ).addClass( 'modal-open' );
$( '#request-filesystem-credentials-dialog' ).show();
}
};
// Bind various click handlers.
$( document ).ready( function() {
// File system credentials form submit noop-er / handler.
$('#request-filesystem-credentials-dialog form').on( 'submit', function() {
$( '#request-filesystem-credentials-dialog form' ).on( 'submit', function() {
// Persist the credentials input by the user for the duration of the page load.
wp.updates.filesystemCredentials.ftp.hostname = $('#hostname').val();
wp.updates.filesystemCredentials.ftp.username = $('#username').val();
@ -402,7 +403,8 @@ window.wp = window.wp || {};
wp.updates.filesystemCredentials.ssh.publicKey = $('#public_key').val();
wp.updates.filesystemCredentials.ssh.privateKey = $('#private_key').val();
$('#request-filesystem-credentials-dialog').hide();
$( '#request-filesystem-credentials-dialog' ).hide();
$( 'body' ).removeClass( 'modal-open' );
// Unlock and invoke the queue.
wp.updates.updateLock = false;