1'use strict'; 2 3var StaticContent = function(){ 4 5 var $ = jQuery; 6 var instances = []; 7 8 9 function onReady() { 10 $('.module.static-content').each(function () { 11 instances.push(initInstance($(this))); 12 }); 13 } 14 15 function initInstance(view) { 16 17 var $view = view, 18 id = $view.data('id'); 19 20 var instance = { 21 init: function () { 22 $(window).resize(resize); 23 checkCenteredImages(); 24 } 25 }; 26 27 function checkCenteredImages() { 28 $view.find('.positionable').each(function (key, value) { 29 if($(this).attr('data-vertical') === 'middle'){ 30 $(this).css('margin-top', ($(this).find('img').innerHeight() / 2) * -1); 31 } 32 }); 33 } 34 35 function getBigestElement($parent, element) { 36 var minimumOld, minimum; 37 38 minimumOld = 0; 39 $parent.each(function(key, child){ 40 if(element){ 41 minimum = $(child).find(element).outerHeight(); 42 }else{ 43 minimum = $(child).outerHeight(); 44 } 45 if(minimum > minimumOld){ 46 minimumOld = minimum; 47 } 48 }); 49 50 return minimumOld; 51 } 52 53 function resize() { 54 checkCenteredImages(); 55 } 56 57 instance.init(); 58 return instance; 59 } 60 61 $(onReady); 62} 63 64StaticContent(); 65
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.