1/******************************************************************************/ 2/******************************************************************************/ 3 4;(function($,doc,win) 5{ 6 "use strict"; 7 8 var windowDimensionListener=function(option) 9 { 10 /**********************************************************************/ 11 12 var option=option; 13 14 /**********************************************************************/ 15 16 this.create=function() 17 { 18 var i; 19 var timer; 20 var initial=false; 21 var dimension=[]; 22 23 var self=this; 24 25 var object= 26 [ 27 { 28 'object' : document.body, 29 'type' : 'body' 30 }, 31 { 32 'object' : window, 33 'type' : 'window' 34 }, 35 { 36 'object' : '.vc_row[data-vc-full-width="true"]', 37 'type' : 'selector' 38 } 39 ]; 40 41 for(i in object) 42 { 43 dimension[i]={}; 44 dimension[i].old=this.getDimension(object[i].object,object[i].type); 45 } 46 47 (function run() 48 { 49 for(i in object) 50 { 51 dimension[i].new=self.getDimension(object[i].object,object[i].type); 52 53 var c=[dimension[i].new.width!==dimension[i].old.width,dimension[i].new.height!==dimension[i].old.height]; 54 55 dimension[i].old=dimension[i].new; 56 57 if((c[0]===false) && (c[1]===false)) 58 { 59 if(!initial) 60 { 61 initial=true; 62 option.change(true,true); 63 break; 64 } 65 } 66 else 67 { 68 option.change(c[0],c[1]); 69 break; 70 } 71 } 72 73 timer=setTimeout(run,100); 74 })(); 75 }; 76 77 /**************************************************************************/ 78 79 this.getDimension=function(object,type) 80 { 81 var dimension={}; 82 83 switch(type) 84 { 85 case 'body': 86 87 dimension.width=document.body.clientWidth; 88 dimension.height=document.body.clientHeight; 89 90 break; 91 92 default: 93 94 dimension.width=$(object).actual('outerWidth'); 95 dimension.height=$(object).actual('outerHeight'); 96 } 97 98 dimension.width=parseInt(dimension.width,10); 99 dimension.height=parseInt(dimension.height,10); 100 101 return(dimension); 102 }; 103 104 /**********************************************************************/ 105 }; 106 107 /**************************************************************************/ 108 109 $.fn.windowDimensionListener=function(option) 110 { 111 var element=new windowDimensionListener(option); 112 element.create(); 113 }; 114 115 /**************************************************************************/ 116 117})(jQuery,document,window);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.