Add an afterShowing hook
A hook that can optionally run after the ULS menu is shown. There are things that cannot be done in ready(), because the style may not have been initialized yet.
This commit is contained in:
1 parent
e91e38afe3
commit
b28bed9bb5
1 file changed
+10
@@ -120,6 +120,12 @@
|
||||
}
|
||||
},
|
||||
|
||||
afterShowing: function () {
|
||||
if ( this.options.afterShowing ) {
|
||||
this.options.afterShowing.call( this );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Calculate the position of ULS
|
||||
* Returns an object with top and left properties.
|
||||
@@ -152,9 +158,11 @@
|
||||
if ( !this.initialized ) {
|
||||
$( 'body' ).prepend( this.$menu );
|
||||
this.i18n();
|
||||
|
||||
// Initialize with a full search.
|
||||
// This happens on first time click of uls trigger.
|
||||
this.defaultSearch();
|
||||
|
||||
this.initialized = true;
|
||||
}
|
||||
|
||||
@@ -164,6 +172,8 @@
|
||||
this.$menu.show();
|
||||
this.shown = true;
|
||||
|
||||
this.afterShowing();
|
||||
|
||||
if ( !this.isMobile() ) {
|
||||
this.$languageFilter.focus();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user