if ( ajaxUploadDestCheck ) {
// Insert an event handler that fetches upload warnings when wpDestFile
// has been changed
- $( '#wpDestFile' ).change( function () {
+ $( '#wpDestFile' ).on( 'change', function () {
uploadWarning.checkNow( $( this ).val() );
} );
// Insert a row where the warnings will be displayed just below the
if ( mw.config.get( 'wgAjaxLicensePreview' ) && $license.length ) {
// License selector check
- $license.change( function () {
+ $license.on( 'change', function () {
// We might show a preview
uploadTemplatePreview.getPreview( $license, $( '#mw-license-preview' ) );
} );
// fillDestFile setup
mw.config.get( 'wgUploadSourceIds' ).forEach( function ( sourceId ) {
- $( '#' + sourceId ).change( function () {
+ $( '#' + sourceId ).on( 'change', function () {
var path, slash, backslash, fname;
if ( !mw.config.get( 'wgUploadAutoFill' ) ) {
return;
/* Initialization */
if ( hasFileAPI() ) {
// Update thumbnail when the file selection control is updated.
- $( '#wpUploadFile' ).change( function () {
+ $( '#wpUploadFile' ).on( 'change', function () {
var file;
clearPreview();
if ( this.files && this.files.length ) {
namespace: 'uploadwarning'
} );
- $uploadForm.submit( function () {
+ $uploadForm.on( 'submit', function () {
allowCloseWindow.release();
} );
} );
// Change tabindex only when main div has focus
if ( $( this ).is( ':focus' ) ) {
- $( this ).find( 'a' ).first().focus();
+ $( this ).find( 'a' ).first().trigger( 'focus' );
setEditTabindex( '0' );
}
} );