Follows-up:
* r75275: Introduced the updateTooltipAccessKeys function in the new library but didn't call it on document ready and left the deprecated one in the onloadhook-run in wikibits.js untouched
* r75287: Introduced jquery.checkboxShiftClick and called on-load but left the load call for the legacy version untouched. Depending on the load order at any given time it may not have been used.
Also reordering the if-else case in mw.util.updateTooltipAccessKeys to allow a call without arguments ("undefined instanceof Foo" throws exception)
/* Enable CheckboxShiftClick */
$( 'input[type=checkbox]:not(.noshiftselect)' ).checkboxShiftClick();
/* Enable CheckboxShiftClick */
$( 'input[type=checkbox]:not(.noshiftselect)' ).checkboxShiftClick();
+ /* Add accesskey hints to the tooltips */
+ mw.util.updateTooltipAccessKeys();
+
* otherwise, all the nodes that will probably have accesskeys by
* default are updated.
*
* otherwise, all the nodes that will probably have accesskeys by
* default are updated.
*
- * @param nodeList mixed A jQuery object, or array of elements to update.
+ * @param nodeList {Array|jQuery} (optional) A jQuery object, or array of elements to update.
*/
'updateTooltipAccessKeys' : function( nodeList ) {
var $nodes;
*/
'updateTooltipAccessKeys' : function( nodeList ) {
var $nodes;
- if ( nodeList instanceof jQuery ) {
- $nodes = nodeList;
- } else if ( nodeList ) {
- $nodes = $( nodeList );
- } else {
// Rather than scanning all links, just the elements that
// contain the relevant links
this.updateTooltipAccessKeys(
// Rather than scanning all links, just the elements that
// contain the relevant links
this.updateTooltipAccessKeys(
// these are rare enough that no such optimization is needed
this.updateTooltipAccessKeys( $( 'input' ) );
this.updateTooltipAccessKeys( $( 'label' ) );
// these are rare enough that no such optimization is needed
this.updateTooltipAccessKeys( $( 'input' ) );
this.updateTooltipAccessKeys( $( 'label' ) );
+
+ } else if ( nodeList instanceof jQuery ) {
+ $nodes = nodeList;
+ } else {
+ $nodes = $( nodeList );
}
$nodes.each( function ( i ) {
}
$nodes.each( function ( i ) {
// might cause the function to terminate prematurely
doneOnloadHook = true;
// might cause the function to terminate prematurely
doneOnloadHook = true;
- updateTooltipAccessKeys( null );
- setupCheckboxShiftClick();
-
// Run any added-on functions
for ( var i = 0; i < onloadFuncts.length; i++ ) {
onloadFuncts[i]();
// Run any added-on functions
for ( var i = 0; i < onloadFuncts.length; i++ ) {
onloadFuncts[i]();