var promise,
api = new mw.Api(),
$link = $( this ),
- $subjectLink = $link.parents( 'li' ).children( 'a' ).eq( 0 ),
+ $subjectLink = $link.closest( 'li' ).children( 'a' ).eq( 0 ),
title = mw.util.getParamValue( 'title', $link.attr( 'href' ) );
// nice format
title = mw.Title.newFromText( title ).toText();
mw.notify( mw.msg( 'addedwatchtext-short', title ) );
} ).fail( function () {
$link.text( mw.msg( 'watch' ) );
- mw.notify( mw.msg( 'watcherrortext', title ) );
+ mw.notify( mw.msg( 'watcherrortext', title ), { type: 'error' } );
} );
} else {
$link.text( mw.msg( 'unwatching' ) );
mw.notify( mw.msg( 'removedwatchtext-short', title ) );
} ).fail( function () {
$link.text( mw.msg( 'unwatch' ) );
- mw.notify( mw.msg( 'watcherrortext', title ) );
+ mw.notify( mw.msg( 'watcherrortext', title ), { type: 'error' } );
} );
}