UNPKG

foundation-sites

Version:

The most advanced responsive front-end framework in the world.

3 lines (2 loc) 3.15 kB
((t,e)=>{"object"==typeof exports&&"object"==typeof module?module.exports=e(require("./foundation.core")):"function"==typeof define&&define.amd?define(["./foundation.core"],e):"object"==typeof exports?exports.__FOUNDATION_EXTERNAL__=e(require("./foundation.core")):(t.__FOUNDATION_EXTERNAL__=t.__FOUNDATION_EXTERNAL__||{},t.__FOUNDATION_EXTERNAL__["foundation.util.box"]=e(t.__FOUNDATION_EXTERNAL__["foundation.core"]))})(self,function(e){return o={"./js/foundation.util.box.js":function(t,e,o){o.r(e),o.d(e,{Box:function(){return f}});var f={ImNotTouchingYou:function(t,e,o,f,n){return 0===i(t,e,o,f,n)},OverlapArea:i,GetDimensions:h,GetExplicitOffsets:function(t,e,o,f,n,i,r){var s,a,u=h(t),d=e?h(e):null;if(null!==d){switch(o){case"top":s=d.offset.top-(u.height+n);break;case"bottom":s=d.offset.top+d.height+n;break;case"left":a=d.offset.left-(u.width+i);break;case"right":a=d.offset.left+d.width+i}switch(o){case"top":case"bottom":switch(f){case"left":a=d.offset.left+i;break;case"right":a=d.offset.left-u.width+d.width-i;break;case"center":a=r?i:d.offset.left+d.width/2-u.width/2+i}break;case"right":case"left":switch(f){case"bottom":s=d.offset.top-n+d.height-u.height;break;case"top":s=d.offset.top+n;break;case"center":s=d.offset.top+n+d.height/2-u.height/2}}}return{top:s,left:a}}};function i(t,e,o,f,n){var i,r,s,t=h(t);return e=e?(i=(e=h(e)).height+e.offset.top-(t.offset.top+t.height),r=t.offset.top-e.offset.top,s=t.offset.left-e.offset.left,e.width+e.offset.left-(t.offset.left+t.width)):(i=t.windowDims.height+t.windowDims.offset.top-(t.offset.top+t.height),r=t.offset.top-t.windowDims.offset.top,s=t.offset.left-t.windowDims.offset.left,t.windowDims.width-(t.offset.left+t.width)),i=n?0:Math.min(i,0),r=Math.min(r,0),s=Math.min(s,0),e=Math.min(e,0),o?s+e:f?r+i:Math.sqrt(r*r+i*i+s*s+e*e)}function h(t){if((t=t.length?t[0]:t)===window||t===document)throw new Error("I'm sorry, Dave. I'm afraid I can't do that.");var e=t.getBoundingClientRect(),t=t.parentNode.getBoundingClientRect(),o=document.body.getBoundingClientRect(),f=window.pageYOffset,n=window.pageXOffset;return{width:e.width,height:e.height,offset:{top:e.top+f,left:e.left+n},parentDims:{width:t.width,height:t.height,offset:{top:t.top+f,left:t.left+n}},windowDims:{width:o.width,height:o.height,offset:{top:f,left:n}}}}},"./foundation.core":function(t){t.exports=e}},n={},f.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return f.d(e,{a:e}),e},f.d=function(t,e){for(var o in e)f.o(e,o)&&!f.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},f.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r={},(f.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})})(r),f.d(r,{Box:function(){return i.Box},Foundation:function(){return t.Foundation}}),t=f("./foundation.core"),i=f("./js/foundation.util.box.js"),t.Foundation.Box=i.Box,r;function f(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},o[t](e,e.exports,f)),e.exports}var o,n,t,i,r}); //# sourceMappingURL=foundation.util.box.min.js.map