From dbcdd63e6919d83612f60694b8f243d85cb3f7a2 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Wed, 15 Aug 2012 20:10:28 +0530 Subject: [PATCH] Documentation for methods Change-Id: I290a2019b80370d3ae462c63fa64abcdceb7c1e8 --- lib/jquery.uls/src/jquery.uls.core.js | 29 +++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/jquery.uls/src/jquery.uls.core.js b/lib/jquery.uls/src/jquery.uls.core.js index 9647e95b..c47cae53 100644 --- a/lib/jquery.uls/src/jquery.uls.core.js +++ b/lib/jquery.uls/src/jquery.uls.core.js @@ -44,9 +44,14 @@ ULS.prototype = { constructor: ULS, + ready: function() { // Currently empty, can be overridden for anything useful. }, + + /** + * Show the ULS window + */ show: function() { var pos = $.extend( {}, this.$element.offset(), { height: this.$element[0].offsetHeight @@ -65,31 +70,44 @@ this.$menu.show(); this.shown = true; this.$languageFilter.focus(); - return this; }, + /** + * Hide the ULS window + */ hide: function() { this.$menu.hide(); this.shown = false; - return this; }, + /** + * Render the UI elements. Can be used for customization + */ render: function() { // Rendering stuff here }, + /** + * callback for no results found context. + * @param String search the search term + */ noresults: function( search ) { this.$noResultsView.show(); - // FIXME i18n this.$noResultsView.find( 'span#uls-no-found-search-term' ).text( search ); this.$resultsView.hide(); }, + /** + * callback for results found context. + */ success: function() { this.$noResultsView.hide(); this.$resultsView.show(); }, + /** + * Bind the UI elements with their event listeners + */ listen: function() { var lcd, that = this; @@ -140,9 +158,12 @@ that.$languageFilter.languagefilter( 'clear' ); } } ); - }, + /** + * On select handler for search results + * @param langCode + */ onSelect: function( langCode ) { if ( this.options.onSelect ) { this.options.onSelect.call( this, langCode );