Merge "mw.htmlform: Fix hiding of the textbox for 'selectorother' fields on page...
[lhc/web/wiklou.git] / resources / src / mediawiki / page / patrol.ajax.js
index 89bbbe7..d8fb249 100644 (file)
                                formatversion: 2,
                                action: 'patrol',
                                rcid: rcid
-                       } )
-                       .done( function ( data ) {
+                       } ).done( function ( data ) {
+                               var title;
                                // Remove all patrollinks from the page (including any spinners inside).
                                $patrolLinks.closest( '.patrollink' ).remove();
                                if ( data.patrol !== undefined ) {
                                        // Success
-                                       var title = new mw.Title( data.patrol.title );
+                                       title = new mw.Title( data.patrol.title );
                                        mw.notify( mw.msg( 'markedaspatrollednotify', title.toText() ) );
                                } else {
                                        // This should never happen as errors should trigger fail
                                        mw.notify( mw.msg( 'markedaspatrollederrornotify' ), { type: 'error' } );
                                }
-                       } )
-                       .fail( function ( error ) {
+                       } ).fail( function ( error ) {
                                $spinner.remove();
                                // Restore the patrol link. This allows the user to try again
                                // (or open it in a new window, bypassing this ajax module).