1Drupal.behaviors.themeFit = function (context){ 2 3 // root 4 //var $root = $(Drupal.settings.themefit.root.selector); 5 //var rw = $root.width() * Drupal.settings.themefit.root.percent / 100; 6 7 var fit = function(target, parent, scaleUp){ 8 $(target).each(function(){ 9 10 $parent = $(this).parents(parent).eq(0); 11 12 var maxwidth = $parent.width(); 13 if(!maxwidth) return this; 14 15 if(!$(this).attr('ow')) $(this).attr('ow', $(this).attr('width') ); 16 if(!$(this).attr('oh')) $(this).attr('oh', $(this).attr('height') ); 17 18 var wr = $(this).attr('ow') / maxwidth; 19 if(wr < 1 && !scaleUp) return; 20 21 var w = maxwidth; 22 var h = Math.round( $(this).attr('oh') / wr); 23 24 $(this).css({width: w, height: h}); 25 26 }); 27 } 28 29 var onResize = function(){ 30 31 var elements = Drupal.settings.themefit.elements; 32 for(var p in elements){ 33 var e = elements[p]; 34 if(e.enabled) fit(e.target, e.parent, e.scaleUp); 35 } 36 37 }; 38 39 40 $(window).bind('resize', function(){ 41 onResize(); 42 }); 43 $(window).load(function(){ 44 onResize(); 45 }); 46 47};
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.