[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 /*+*********************************************************************************** 2 * The contents of this file are subject to the vtiger CRM Public License Version 1.0 3 * ("License"); You may not use this file except in compliance with the License 4 * The Original Code is: vtiger CRM Open Source 5 * The Initial Developer of the Original Code is vtiger. 6 * Portions created by vtiger are Copyright (C) vtiger. 7 * All Rights Reserved. 8 *************************************************************************************/ 9 10 (function( $ ) { 11 12 var vtImageLoader = function(element, options) { 13 var thisInstance = this; 14 this.defaults = { 15 'position' : 'append', 16 'mode' : 'show' 17 } 18 19 if(typeof options == 'undefined'){ 20 options = {}; 21 } 22 23 this.options = $.extend(this.defaults, options); 24 this.container = element; 25 this.position = options.position 26 27 this.show = function(){ 28 var imagePath = 'themes/vlayout/images/loading.gif'; 29 var imageHtml = '<span class="imageHolder"><img class="loadinImg" src="'+imagePath+'" /></span>'; 30 31 switch(thisInstance.position) { 32 case "prepend": 33 thisInstance.container.prepend(imageHtml); 34 break; 35 case "html": 36 thisInstance.container.html(imageHtml); 37 break; 38 case "replace": 39 thisInstance.container.replaceWith(imageHtml); 40 break; 41 default: 42 thisInstance.container.append(imageHtml); 43 } 44 } 45 46 this.hide = function() { 47 $('.imageHolder',this.container).remove(); 48 } 49 50 51 if(this.options.mode == 'show'){ 52 this.show(); 53 }else if(this.options.mode == 'hide') { 54 this.hide(); 55 } 56 57 } 58 59 $.fn.vtLoadImage = function(options) { 60 return this.each(function(index, element){ 61 var jQueryObject = $(element); 62 var imageLoader = new vtImageLoader(jQueryObject, options); 63 jQueryObject.data('imageLoader',imageLoader); 64 }); 65 66 }; 67 })( jQuery ); 68
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |