UNPKG

@mornya/react-social-libs

Version:

The project of React.js Social Share and Widget modules.

1 lines 944 B
var a=this&&this.__read||function(o,n){var e="function"==typeof Symbol&&o[Symbol.iterator];if(!e)return o;var r,t,i=e.call(o),c=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)c.push(r.value)}catch(o){t={error:o}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return c};function openWindow(o,n,e,r){return void 0===r&&(r=0),null!=(r=(e=void 0===e?0:e)&&r?(e=["width=".concat(e,"px"),"height=".concat(r,"px"),"left=".concat((window.screen.width-e)/2,"px"),"top=".concat((window.screen.height-r)/2,"px")].join(","),window.open(o,n,e)):window.open(o,n))?(r.focus(),r):(window.location.href=o,null)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.openShareWindow=function openShareWindow(t,i,c){void 0===c&&(c=[]);return new Promise(function(o){var n,e,r="__sns_share_".concat(i,"__");(e=2===c.length?(e=(n=a(c,2))[0],openWindow(t,r,e,n[1])):openWindow(t,r))?e.focus():window.location.href=t,o()})};