1 define('loading',     
  2 	['jquery'], 
  3     function ($) {
  4    		/**
  5 		 * A Class to handle the Loading icon in the screen whenevr any ajax loading or long running process happens the show() function will be shown.
  6 		 * @name loading
  7 		 * @class loading
  8 		 * @example require('loading')
  9 		 * @exports loading
 10 		 * @version 1.0
 11 		 * @module loading
 12 		 * @augments jquery
 13 		 **/
 14         return {
 15         	loading:false,
 16         	setLoading:function(){
 17         		this.loading = true;
 18         	},
 19         	isLoading:function(){
 20         		return this.loading;
 21         	},
 22 			/**
 23 			 * @name show
 24 			 * @memberOf loading
 25 			 * @method 
 26 			 * @description Function to show the loading icon on the screen.
 27 			 * @example require('loading').show() 
 28 			 * @function
 29 			 */
 30 			show:function(){
 31 				$('#divLoading').css('left', $(window).width()/2-24);
 32 				$('#divLoading').css('top', $(window).height()/2-24);
 33 				$('#divLoading').show();
 34 			},
 35 			/**
 36 			 * @name hide
 37 			 * @memberOf loading
 38 			 * @method 
 39 			 * @description Function to hide the loading icon on the screen.
 40 			 * @example require('loading').hide() 
 41 			 * @function
 42 			 */
 43 			hide:function(){
 44 				$('#divLoading').hide();
 45 				this.loading = false;
 46 			}
 47         };
 48 });
 49 
 50