1(function ($) { 2 'use strict'; 3 $.fn.ngStickyButton = function () { 4 this.each(function () { 5 6 var that = $(this), 7 position = that.attr('data-ngstickybuttonposition'), 8 delay = that.attr('data-ngstickybuttondelay'); 9 10 function place() { 11 var width = that.outerWidth(), 12 height = that.outerHeight(), 13 wwidth = $(window).width(), 14 wheight = $(window).height(), 15 left, top, right, bottom; 16 17 switch (position) { 18 case 'topleft': 19 left = Math.floor(wwidth * 0.10); 20 that.css({ 21 'top': 0, 22 'left': left + 'px' 23 }); 24 break; 25 case 'topright': 26 right = Math.floor(wwidth * 0.10); 27 that.css({ 28 'top': 0, 29 'right': right + 'px' 30 }); 31 break; 32 case 'topcenter': 33 left = Math.floor((wwidth - width) / 2); 34 that.css({ 35 'top': 0, 36 'left': left + 'px' 37 }); 38 break; 39 case 'rightupper': 40 right = Math.floor((height - width) / 2); 41 top = Math.floor(wheight * 0.10 + (width - height) / 2); 42 that.css({ 43 'top': top + 'px', 44 'right': right + 'px' 45 }); 46 break; 47 case 'rightlower': 48 right = Math.floor((height - width) / 2); 49 bottom = Math.floor(wheight * 0.10 + (width - height) / 2); 50 that.css({ 51 'bottom': bottom + 'px', 52 'right': right + 'px' 53 }); 54 break; 55 case 'rightmiddle': 56 right = Math.floor((height - width) / 2); 57 top = Math.floor((wheight - height) / 2); 58 that.css({ 59 'top': top + 'px', 60 'right': right + 'px' 61 }); 62 break; 63 case 'leftupper': 64 left = Math.floor((height - width) / 2); 65 top = Math.floor(wheight * 0.10 + (width - height) / 2); 66 that.css({ 67 'top': top + 'px', 68 'left': left + 'px' 69 }); 70 break; 71 case 'leftmiddle': 72 left = Math.floor((height - width) / 2); 73 top = Math.floor((wheight - height) / 2); 74 that.css({ 75 'top': top + 'px', 76 'left': left + 'px' 77 }); 78 break; 79 case 'leftlower': 80 left = Math.floor((height - width) / 2); 81 bottom = Math.floor(wheight * 0.10 + (width - height) / 2); 82 that.css({ 83 'bottom': bottom + 'px', 84 'left': left + 'px' 85 }); 86 break; 87 case 'bottomcenter': 88 left = Math.floor((wwidth - width) / 2); 89 that.css({ 90 'bottom': '0', 91 'left': left + 'px' 92 }); 93 break; 94 case 'bottomright': 95 right = Math.floor($(window).width() * 0.10); 96 that.css({ 97 'bottom': '0', 98 'right': right + 'px' 99 }); 100 break; 101 case 'bottomleft': 102 left = Math.floor($(window).width() * 0.10); 103 that.css({ 104 'bottom': '0', 105 'left': left + 'px' 106 }); 107 break; 108 } 109 } 110 111 place(); 112 113 $(window).on('resize load', place); 114 115 if (delay > 0) { 116 window.setTimeout(function () { 117 that.removeClass('ngparastickybuttonhidden'); 118 }, delay * 1000); 119 } 120 121 return this; 122 }); 123 }; 124})(jQuery); 125 126$(function() { 127 $('.ngparastickybutton').ngStickyButton(); 128});
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.