diff --git a/src/jquery.uls.core.js b/src/jquery.uls.core.js index bd175c1..5546155 100644 --- a/src/jquery.uls.core.js +++ b/src/jquery.uls.core.js @@ -114,15 +114,26 @@ ULS.prototype = { constructor: ULS, + // A "hook" that runs after the ULS constructor. + // At this point it is not guaranteed that the ULS has its dimensions + // and that the languages lists are initialized. + // + // To use it, pass a function as the onReady parameter + // in the options when initializing ULS. ready: function () { if ( this.options.onReady ) { this.options.onReady.call( this ); } }, - afterShowing: function () { - if ( this.options.afterShowing ) { - this.options.afterShowing.call( this ); + // A "hook" that runs after the ULS panel becomes visible + // by using the show method. + // + // To use it, pass a function as the onVisible parameter + // in the options when initializing ULS. + visible: function () { + if ( this.options.onVisible ) { + this.options.onVisible.call( this ); } }, @@ -166,17 +177,17 @@ this.initialized = true; } - // hide any other ULS visible + // hide any other visible ULS $( '.uls-menu' ).hide(); this.$menu.show(); this.shown = true; - this.afterShowing(); - if ( !this.isMobile() ) { this.$languageFilter.focus(); } + + this.visible(); }, i18n: function () {