context.data.$textbox.val( result.data( 'text' ) );
// .val() doesn't call any event handlers, so
// let the world know what happened
- context.data.$textbox.change();
+ context.data.$textbox.trigger( 'change' );
}
context.data.$textbox.trigger( 'change' );
}
}
// Always bring focus to the textbox, as that's probably where the user expects it
// if they were just typing.
- context.data.$textbox.focus();
+ context.data.$textbox.trigger( 'focus' );
} )
)
.append(
}
// Always bring focus to the textbox, as that's probably where the user expects it
// if they were just typing.
- context.data.$textbox.focus();
+ context.data.$textbox.trigger( 'focus' );
} )
.on( 'mousemove', function ( e ) {
context.data.selectedWithMouse = true;
*/
( function () {
$( function () {
- mw.util.$content.dblclick( function ( e ) {
+ mw.util.$content.on( 'dblclick', function ( e ) {
var $a;
// Recheck preference so extensions can do a hack to disable this code.
if ( parseInt( mw.user.options.get( 'editondblclick' ), 10 ) ) {
mw.rcfilters.ui.FilterTagMultiselectWidget.parent.prototype.doInputEscape.call( this );
// Blur the input
- this.input.$input.blur();
+ this.input.$input.trigger( 'blur' );
};
/**
* Respond to the user choosing a title
*/
mw.rcfilters.ui.RclTargetPageWidget.prototype.onLookupMenuItemChoose = function () {
- this.titleSearch.$input.blur();
+ this.titleSearch.$input.trigger( 'blur' );
};
/**
this.saveButton.toggle( isEdit );
if ( isEdit ) {
- this.editInput.$input.focus();
+ this.editInput.$input.trigger( 'focus' );
}
this.editing = isEdit;
}
mw.widgets.datetime.CalendarWidget.prototype.onPrevClick = function () {
this.setFocusedDate( this.adjustDate( this.getFocusedDate(), 'month', -1 ) );
if ( !this.$widget || OO.ui.contains( this.$element[ 0 ], document.activeElement, true ) ) {
- this.$element.focus();
+ this.$element.trigger( 'focus' );
}
};
mw.widgets.datetime.CalendarWidget.prototype.onNextClick = function () {
this.setFocusedDate( this.adjustDate( this.getFocusedDate(), 'month', 1 ) );
if ( !this.$widget || OO.ui.contains( this.$element[ 0 ], document.activeElement, true ) ) {
- this.$element.focus();
+ this.$element.trigger( 'focus' );
}
};
this.setFocusedDate( $button.getData() );
this.setSelected( [ $button.getData() ] );
if ( !this.$widget || OO.ui.contains( this.$element[ 0 ], document.activeElement, true ) ) {
- this.$element.focus();
+ this.$element.trigger( 'focus' );
}
};
*/
mw.widgets.datetime.DateTimeInputWidget.prototype.focus = function () {
if ( !this.getFocusedField().length ) {
- this.$fields.find( '.mw-widgets-datetime-dateTimeInputWidget-editField' ).first().focus();
+ this.$fields.find( '.mw-widgets-datetime-dateTimeInputWidget-editField' ).first().trigger( 'focus' );
}
return this;
};
// Tabbing backward from text input: normal browser behavior
} else {
// Tabbing forward from text input: just focus the calendar
- this.calendar.$element.focus();
+ this.calendar.$element.trigger( 'focus' );
return false;
}
}
if ( e.which === OO.ui.Keys.TAB ) {
if ( e.shiftKey ) {
// Tabbing backward from calendar: just focus the text input
- this.textInput.$input.focus();
+ this.textInput.$input.trigger( 'focus' );
return false;
} else {
// Tabbing forward from calendar: focus the text input, then allow normal browser
// behavior to move focus to next focusable after it
- this.textInput.$input.focus();
+ this.textInput.$input.trigger( 'focus' );
}
}
}.bind( this ) );
if ( userSelected ) {
// Prevent focusing the handle from reopening the calendar
this.closing = true;
- this.$handle.focus();
+ this.$handle.trigger( 'focus' );
this.closing = false;
}
this.textInput.toggle( true );
this.calendar.toggle( true );
- this.textInput.$input.focus();
+ this.textInput.$input.trigger( 'focus' );
};
/**
mw.widgets.SearchInputWidget.parent.prototype.onLookupMenuItemChoose.apply( this, arguments );
if ( this.performSearchOnClick ) {
- this.$element.closest( 'form' ).submit();
+ this.$element.closest( 'form' ).trigger( 'submit' );
}
};