31 lines
841 B
JavaScript
31 lines
841 B
JavaScript
// JavaScript Document
|
|
(function( $ ){
|
|
|
|
var methods = {
|
|
show : function( ) {
|
|
var id = "getcategory-ajax-loading-dom";
|
|
var loadingdiv = '<span id="'+ id +'"><img src="/images/ajax-load-small.gif" /></div>';
|
|
$(this).append(loadingdiv);
|
|
},
|
|
hide : function( ) {
|
|
if($('#getcategory-ajax-loading-dom').length > 0)
|
|
{
|
|
$('#getcategory-ajax-loading-dom').remove();
|
|
}
|
|
}
|
|
};
|
|
|
|
$.fn.loadinglayer = function( method ) {
|
|
|
|
// Method calling logic
|
|
if ( methods[method] ) {
|
|
return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
|
|
} else if ( typeof method === 'object' || ! method ) {
|
|
return methods.init.apply( this, arguments );
|
|
} else {
|
|
$.error( 'Method ' + method + ' does not exist' );
|
|
}
|
|
|
|
};
|
|
|
|
})( jQuery ); |