Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "beside", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"homepage": "https://github.com/forsigner/beside", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -182,2 +182,12 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
case 'top left diagonal': | ||
top = top - rectYou.height; | ||
left = left - rectYou.width; | ||
break; | ||
case 'top right diagonal': | ||
top = top - rectYou.height; | ||
left = left + rectMe.width; | ||
break; | ||
case 'bottom center': | ||
@@ -194,2 +204,10 @@ top = top + rectMe.height; | ||
break; | ||
case 'bottom left diagonal': | ||
top = top + rectMe.height; | ||
left = left - rectYou.width; | ||
break; | ||
case 'bottom right diagonal': | ||
top = top + rectMe.height; | ||
left = left + rectMe.width; | ||
break; | ||
@@ -219,2 +237,39 @@ case 'left center': | ||
break; | ||
case 'top left inner': | ||
// nothing | ||
break; | ||
case 'top center inner': | ||
left = left - rectYou.width / 2 + rectMe.width / 2; | ||
break; | ||
case 'top right inner': | ||
left = left - rectYou.width + rectMe.width; | ||
break; | ||
case 'left center inner': | ||
top = top - rectYou.height / 2 + rectMe.height / 2; | ||
break; | ||
case 'left center inner': | ||
top = top - rectYou.height / 2 + rectMe.height / 2; | ||
break; | ||
case 'center center inner': | ||
top = top - rectYou.height / 2 + rectMe.height / 2; | ||
left = left - rectYou.width / 2 + rectMe.width / 2; | ||
break; | ||
case 'right center inner': | ||
top = top - rectYou.height / 2 + rectMe.height / 2; | ||
left = left - rectYou.width + rectMe.width; | ||
break; | ||
case 'bottom left inner': | ||
top = top - rectYou.height + rectMe.height; | ||
break; | ||
case 'bottom center inner': | ||
top = top - rectYou.height + rectMe.height; | ||
left = left - rectYou.width / 2 + rectMe.width / 2; | ||
break; | ||
case 'bottom right inner': | ||
top = top - rectYou.height + rectMe.height; | ||
left = left - rectYou.width + rectMe.width; | ||
break; | ||
default: | ||
@@ -221,0 +276,0 @@ break; |
@@ -1,1 +0,1 @@ | ||
!function t(e,n,o){function i(c,u){if(!n[c]){if(!e[c]){var d="function"==typeof require&&require;if(!u&&d)return d(c,!0);if(r)return r(c,!0);var s=new Error("Cannot find module '"+c+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[c]={exports:{}};e[c][0].call(f.exports,function(t){var n=e[c][1][t];return i(n?n:t)},f,f.exports,t,e,n,o)}return n[c].exports}for(var r="function"==typeof require&&require,c=0;c<o.length;c++)i(o[c]);return i}({1:[function(t,e,n){"use strict";function o(t){var e=Object.create(i);e.init(t)}var i=t("./instance");e.exports={init:o}},{"./instance":5}],2:[function(t,e,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i=t("./beside");!function(t){"function"==typeof define&&define.amd?define([],t):"object"===("undefined"==typeof window?"undefined":o(window))&&(window.beside=t())}(function(){return i})},{"./beside":1}],3:[function(t,e,n){"use strict";function o(t,e){var n=window.getComputedStyle(t)[e];return(parseInt(n,10)||0===parseInt(n,10))&&(n=parseInt(n,10)),n}function i(t,e,n){return"number"==typeof n&&"opacity"!==e&&(n=n.toString()+"px"),t.style[e]=n,t}function r(t,e){for(var n in e){var o=e[n];"number"==typeof o&&"opacity"!==n&&(o=o.toString()+"px"),t.style[n]=o}return t}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},u={createElement:function(t){var e=document.createElement("div");return e.innerHTML=t,e.firstElementChild},appendTo:function(t,e){e.appendChild(t)},addClass:function(t,e){var n=t.className.split(" ");return n.indexOf(e)<0&&n.push(e),t.className=n.join(" "),t},removeClass:function(t,e){var n=t.className.split(" "),o=n.indexOf(e);return o>-1&&n.splice(o,1),t.className=n.join(" "),t},css:function(t,e,n){return"object"===("undefined"==typeof e?"undefined":c(e))?r(t,e):"undefined"==typeof n?o(t,e):i(t,e,n)}};e.exports=u},{}],4:[function(t,e,n){"use strict";var o={bind:function(t,e,n){t.addEventListener(e,n,!1)},unbind:function(t,e,n){t.removeEventListener(e,n,!1)},once:function i(t,e,n){var o=this,i=function r(i){o.unbind(t,e,r),n(i)};o.bind(t,e,i)}};e.exports=o},{}],5:[function(t,e,n){"use strict";var o=t("./dom"),i=t("./event");e.exports={init:function(t){function e(){var e=void 0!==window.pageXOffset,i="CSS1Compat"===(document.compatMode||""),c=e?window.pageXOffset:i?document.documentElement.scrollLeft:document.body.scrollLeft,u=e?window.pageYOffset:i?document.documentElement.scrollTop:document.body.scrollTop,d=r.getBoundingClientRect(),s=n.getBoundingClientRect(),f=o.css(document.documentElement,"margin-top"),a=o.css(document.documentElement,"margin-left"),p=o.css(document.documentElement,"padding-top"),m=o.css(document.body,"margin-top"),l=o.css(document.body,"margin-left"),h=o.css(document.body,"padding-top"),b=s.top+u-f-m-p,y=s.left+c-l-a-h;switch(t.where){case"top center":b-=d.height,y=y-d.width/2+s.width/2;break;case"top left":b-=d.height;break;case"top right":b-=d.height,y=y-d.width+s.width;break;case"bottom center":b+=s.height,y=y-d.width/2+s.width/2;break;case"bottom left":b+=s.height;break;case"bottom right":b+=s.height,y=y-d.width+s.width;break;case"left center":b=b-d.height/2+s.height/2,y-=d.width;break;case"left top":y-=d.width;break;case"left bottom":b=b-d.height+s.height,y-=d.width;break;case"right center":b=b-d.height/2+s.height/2,y+=s.width;break;case"right top":y+=s.width;break;case"right bottom":b=b-d.height+s.height,y+=s.width}o.css(r,{position:"absolute",top:b+"px",left:y+"px",opacity:1})}var n=t.me,r=t.you,c=document.body;e(),c.appendChild(r),i.bind(window,"resize",function(){e()})}}},{"./dom":3,"./event":4}]},{},[2]); | ||
!function e(t,n,i){function o(c,a){if(!n[c]){if(!t[c]){var d="function"==typeof require&&require;if(!a&&d)return d(c,!0);if(r)return r(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var s=n[c]={exports:{}};t[c][0].call(s.exports,function(e){var n=t[c][1][e];return o(n?n:e)},s,s.exports,e,t,n,i)}return n[c].exports}for(var r="function"==typeof require&&require,c=0;c<i.length;c++)o(i[c]);return o}({1:[function(e,t,n){"use strict";function i(e){var t=Object.create(o);t.init(e)}var o=e("./instance");t.exports={init:i}},{"./instance":5}],2:[function(e,t,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},o=e("./beside");!function(e){"function"==typeof define&&define.amd?define([],e):"object"===("undefined"==typeof window?"undefined":i(window))&&(window.beside=e())}(function(){return o})},{"./beside":1}],3:[function(e,t,n){"use strict";function i(e,t){var n=window.getComputedStyle(e)[t];return(parseInt(n,10)||0===parseInt(n,10))&&(n=parseInt(n,10)),n}function o(e,t,n){return"number"==typeof n&&"opacity"!==t&&(n=n.toString()+"px"),e.style[t]=n,e}function r(e,t){for(var n in t){var i=t[n];"number"==typeof i&&"opacity"!==n&&(i=i.toString()+"px"),e.style[n]=i}return e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},a={createElement:function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild},appendTo:function(e,t){t.appendChild(e)},addClass:function(e,t){var n=e.className.split(" ");return n.indexOf(t)<0&&n.push(t),e.className=n.join(" "),e},removeClass:function(e,t){var n=e.className.split(" "),i=n.indexOf(t);return i>-1&&n.splice(i,1),e.className=n.join(" "),e},css:function(e,t,n){return"object"===("undefined"==typeof t?"undefined":c(t))?r(e,t):"undefined"==typeof n?i(e,t):o(e,t,n)}};t.exports=a},{}],4:[function(e,t,n){"use strict";var i={bind:function(e,t,n){e.addEventListener(t,n,!1)},unbind:function(e,t,n){e.removeEventListener(t,n,!1)},once:function o(e,t,n){var i=this,o=function r(o){i.unbind(e,t,r),n(o)};i.bind(e,t,o)}};t.exports=i},{}],5:[function(e,t,n){"use strict";var i=e("./dom"),o=e("./event");t.exports={init:function(e){function t(){var t=void 0!==window.pageXOffset,o="CSS1Compat"===(document.compatMode||""),c=t?window.pageXOffset:o?document.documentElement.scrollLeft:document.body.scrollLeft,a=t?window.pageYOffset:o?document.documentElement.scrollTop:document.body.scrollTop,d=r.getBoundingClientRect(),h=n.getBoundingClientRect(),s=i.css(document.documentElement,"margin-top"),u=i.css(document.documentElement,"margin-left"),f=i.css(document.documentElement,"padding-top"),p=i.css(document.body,"margin-top"),l=i.css(document.body,"margin-left"),m=i.css(document.body,"padding-top"),b=h.top+a-s-p-f,g=h.left+c-l-u-m;switch(e.where){case"top center":b-=d.height,g=g-d.width/2+h.width/2;break;case"top left":b-=d.height;break;case"top right":b-=d.height,g=g-d.width+h.width;break;case"top left diagonal":b-=d.height,g-=d.width;break;case"top right diagonal":b-=d.height,g+=h.width;break;case"bottom center":b+=h.height,g=g-d.width/2+h.width/2;break;case"bottom left":b+=h.height;break;case"bottom right":b+=h.height,g=g-d.width+h.width;break;case"bottom left diagonal":b+=h.height,g-=d.width;break;case"bottom right diagonal":b+=h.height,g+=h.width;break;case"left center":b=b-d.height/2+h.height/2,g-=d.width;break;case"left top":g-=d.width;break;case"left bottom":b=b-d.height+h.height,g-=d.width;break;case"right center":b=b-d.height/2+h.height/2,g+=h.width;break;case"right top":g+=h.width;break;case"right bottom":b=b-d.height+h.height,g+=h.width;break;case"top left inner":break;case"top center inner":g=g-d.width/2+h.width/2;break;case"top right inner":g=g-d.width+h.width;break;case"left center inner":b=b-d.height/2+h.height/2;break;case"left center inner":b=b-d.height/2+h.height/2;break;case"center center inner":b=b-d.height/2+h.height/2,g=g-d.width/2+h.width/2;break;case"right center inner":b=b-d.height/2+h.height/2,g=g-d.width+h.width;break;case"bottom left inner":b=b-d.height+h.height;break;case"bottom center inner":b=b-d.height+h.height,g=g-d.width/2+h.width/2;break;case"bottom right inner":b=b-d.height+h.height,g=g-d.width+h.width}i.css(r,{position:"absolute",top:b+"px",left:g+"px",opacity:1})}var n=e.me,r=e.you,c=document.body;t(),c.appendChild(r),o.bind(window,"resize",function(){t()})}}},{"./dom":3,"./event":4}]},{},[2]); |
{ | ||
"name": "beside", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "beside me", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -47,2 +47,12 @@ 'use strict'; | ||
case 'top left diagonal': | ||
top = top - rectYou.height; | ||
left = left - rectYou.width; | ||
break; | ||
case 'top right diagonal': | ||
top = top - rectYou.height; | ||
left = left + rectMe.width; | ||
break; | ||
case 'bottom center': | ||
@@ -59,2 +69,10 @@ top = top + rectMe.height; | ||
break; | ||
case 'bottom left diagonal': | ||
top = top + rectMe.height; | ||
left = left - rectYou.width; | ||
break; | ||
case 'bottom right diagonal': | ||
top = top + rectMe.height; | ||
left = left + rectMe.width; | ||
break; | ||
@@ -84,2 +102,39 @@ case 'left center': | ||
break; | ||
case 'top left inner': | ||
// nothing | ||
break; | ||
case 'top center inner': | ||
left = left - rectYou.width / 2 + rectMe.width / 2; | ||
break; | ||
case 'top right inner': | ||
left = left - rectYou.width + rectMe.width; | ||
break; | ||
case 'left center inner': | ||
top = top - rectYou.height / 2 + rectMe.height / 2; | ||
break; | ||
case 'left center inner': | ||
top = top - rectYou.height / 2 + rectMe.height / 2; | ||
break; | ||
case 'center center inner': | ||
top = top - rectYou.height / 2 + rectMe.height / 2; | ||
left = left - rectYou.width / 2 + rectMe.width / 2; | ||
break; | ||
case 'right center inner': | ||
top = top - rectYou.height / 2 + rectMe.height / 2; | ||
left = left - rectYou.width + rectMe.width; | ||
break; | ||
case 'bottom left inner': | ||
top = top - rectYou.height + rectMe.height; | ||
break; | ||
case 'bottom center inner': | ||
top = top - rectYou.height + rectMe.height; | ||
left = left - rectYou.width / 2 + rectMe.width / 2; | ||
break; | ||
case 'bottom right inner': | ||
top = top - rectYou.height + rectMe.height; | ||
left = left - rectYou.width + rectMe.width; | ||
break; | ||
default: | ||
@@ -86,0 +141,0 @@ break; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
26237
19
536
1
47