@chief-editor/ui
Version:
UI Component for chief editor
1 lines • 466 B
JavaScript
;function getTranslate(e,t,r,s){void 0===s&&(s=!1);var a=0,n=!1,o=!1,i="translateX";if(e&&t&&null!==r){var l=0,f=0,c=0;s?(i="translateY",l=e.clientHeight,f=t.offsetHeight):(l=e.clientWidth,f=t.scrollWidth);var d=l-f;n=(a=(a=d<(c="number"==typeof r?r:s?-r.offsetTop:-r.offsetLeft)?c:d)>0?0:a)<0,o=d<a}return{showPrev:n,showNext:o,translate:{direction:i,distance:a}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getTranslate=getTranslate;