Avoid useless jQuery.click shortcut

Why have one event API when you can have ten...

Change-Id: I645cbeb4e486aba9e734ba47d2e7c3958a694f19
This commit is contained in:
Ed Sanders 2015-12-09 17:34:00 +00:00
parent a9894809f6
commit e9250d87fd
3 changed files with 6 additions and 6 deletions

View file

@ -408,7 +408,7 @@
$caVeEdit.remove(); $caVeEdit.remove();
} else if ( pageCanLoadVE ) { } else if ( pageCanLoadVE ) {
// Allow instant switching to edit mode, without refresh // Allow instant switching to edit mode, without refresh
$caVeEdit.click( init.onEditTabClick ); $caVeEdit.on( 'click', init.onEditTabClick );
} }
// Alter the edit tab (#ca-edit) // Alter the edit tab (#ca-edit)
@ -523,7 +523,7 @@
// and would preserve the wrong DOM with a diff on top. // and would preserve the wrong DOM with a diff on top.
$editsections $editsections
.find( '.mw-editsection-visualeditor' ) .find( '.mw-editsection-visualeditor' )
.click( init.onEditSectionLinkClick ) .on( 'click', init.onEditSectionLinkClick )
; ;
} }
}, },
@ -755,7 +755,7 @@
// Handle section edit link clicks // Handle section edit link clicks
$( '.mw-editsection a' ).on( 'click', init.onEditSectionLinkClick ); $( '.mw-editsection a' ).on( 'click', init.onEditSectionLinkClick );
// Allow instant switching to edit mode, without refresh // Allow instant switching to edit mode, without refresh
$( '#ca-edit' ).click( function ( e ) { $( '#ca-edit' ).on( 'click', function ( e ) {
if ( if (
mw.user.options.get( 'visualeditor-tabs' ) === 'prefer-ve' || mw.user.options.get( 'visualeditor-tabs' ) === 'prefer-ve' ||
( (

View file

@ -860,9 +860,9 @@ ve.init.mw.DesktopArticleTarget.prototype.setupSkinTabs = function () {
if ( this.isViewPage ) { if ( this.isViewPage ) {
// Allow instant switching back to view mode, without refresh // Allow instant switching back to view mode, without refresh
$( '#ca-view a, #ca-nstab-visualeditor a' ) $( '#ca-view a, #ca-nstab-visualeditor a' )
.click( this.onViewTabClick.bind( this ) ); .on( 'click', this.onViewTabClick.bind( this ) );
$( '#ca-viewsource, #ca-edit' ).click( function ( e ) { $( '#ca-viewsource, #ca-edit' ).on( 'click', function ( e ) {
if ( !target.active || e.which !== 1 || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey ) { if ( !target.active || e.which !== 1 || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey ) {
return; return;
} }

View file

@ -58,7 +58,7 @@ ve.ui.MWEducationPopupTool = function VeUiMwEducationPopupTool( config ) {
this.shownEducationPopup = false; this.shownEducationPopup = false;
this.$pulsatingDot = $( '<div>' ).addClass( 've-ui-pulsatingDot' ); this.$pulsatingDot = $( '<div>' ).addClass( 've-ui-pulsatingDot' );
this.$stillDot = $( '<div>' ).addClass( 've-ui-stillDot' ); this.$stillDot = $( '<div>' ).addClass( 've-ui-stillDot' );
$shield = $( '<div>' ).addClass( 've-ui-educationPopup-shield' ).click( function () { $shield = $( '<div>' ).addClass( 've-ui-educationPopup-shield' ).on( 'click', function () {
if ( !tool.shownEducationPopup ) { if ( !tool.shownEducationPopup ) {
if ( ve.init.target.openEducationPopupTool ) { if ( ve.init.target.openEducationPopupTool ) {
ve.init.target.openEducationPopupTool.popup.toggle( false ); ve.init.target.openEducationPopupTool.popup.toggle( false );