Documentation for methods
Change-Id: I290a2019b80370d3ae462c63fa64abcdceb7c1e8
This commit is contained in:
@@ -44,9 +44,14 @@
|
|||||||
|
|
||||||
ULS.prototype = {
|
ULS.prototype = {
|
||||||
constructor: ULS,
|
constructor: ULS,
|
||||||
|
|
||||||
ready: function() {
|
ready: function() {
|
||||||
// Currently empty, can be overridden for anything useful.
|
// Currently empty, can be overridden for anything useful.
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the ULS window
|
||||||
|
*/
|
||||||
show: function() {
|
show: function() {
|
||||||
var pos = $.extend( {}, this.$element.offset(), {
|
var pos = $.extend( {}, this.$element.offset(), {
|
||||||
height: this.$element[0].offsetHeight
|
height: this.$element[0].offsetHeight
|
||||||
@@ -65,31 +70,44 @@
|
|||||||
this.$menu.show();
|
this.$menu.show();
|
||||||
this.shown = true;
|
this.shown = true;
|
||||||
this.$languageFilter.focus();
|
this.$languageFilter.focus();
|
||||||
return this;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide the ULS window
|
||||||
|
*/
|
||||||
hide: function() {
|
hide: function() {
|
||||||
this.$menu.hide();
|
this.$menu.hide();
|
||||||
this.shown = false;
|
this.shown = false;
|
||||||
return this;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render the UI elements. Can be used for customization
|
||||||
|
*/
|
||||||
render: function() {
|
render: function() {
|
||||||
// Rendering stuff here
|
// Rendering stuff here
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* callback for no results found context.
|
||||||
|
* @param String search the search term
|
||||||
|
*/
|
||||||
noresults: function( search ) {
|
noresults: function( search ) {
|
||||||
this.$noResultsView.show();
|
this.$noResultsView.show();
|
||||||
// FIXME i18n
|
|
||||||
this.$noResultsView.find( 'span#uls-no-found-search-term' ).text( search );
|
this.$noResultsView.find( 'span#uls-no-found-search-term' ).text( search );
|
||||||
this.$resultsView.hide();
|
this.$resultsView.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* callback for results found context.
|
||||||
|
*/
|
||||||
success: function() {
|
success: function() {
|
||||||
this.$noResultsView.hide();
|
this.$noResultsView.hide();
|
||||||
this.$resultsView.show();
|
this.$resultsView.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bind the UI elements with their event listeners
|
||||||
|
*/
|
||||||
listen: function() {
|
listen: function() {
|
||||||
var lcd,
|
var lcd,
|
||||||
that = this;
|
that = this;
|
||||||
@@ -140,9 +158,12 @@
|
|||||||
that.$languageFilter.languagefilter( 'clear' );
|
that.$languageFilter.languagefilter( 'clear' );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On select handler for search results
|
||||||
|
* @param langCode
|
||||||
|
*/
|
||||||
onSelect: function( langCode ) {
|
onSelect: function( langCode ) {
|
||||||
if ( this.options.onSelect ) {
|
if ( this.options.onSelect ) {
|
||||||
this.options.onSelect.call( this, langCode );
|
this.options.onSelect.call( this, langCode );
|
||||||
|
|||||||
Reference in New Issue
Block a user