@mornya/react-social-libs
Version:
The project of React.js Social Share and Widget modules.
1 lines • 1.32 kB
JavaScript
var n,t,e=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}),o=(Object.defineProperty(exports,"__esModule",{value:!0}),require("../utils/BaseShareComponent")),o=(t=o.BaseShareComponent,e(Email,t),Email.prototype.onInit=function(){this.initialize("Email",{title:function(t){return null!=(t=t.title)?t:""},message:function(t){return""}})},Email.prototype.onMount=function(t){this.setApiStep()},Email.prototype.onShare=function(t,e){var n=this,o={subject:null!=(o=null==(o=t.title)?void 0:o.call(t,e))?o:"",body:(null==(o=t.message)?void 0:o.call(t,e))||"".concat(e.description).concat(this.getHashtag(t.hashtags,"\n"))+"\n\n"+e.url},t=document.createElement("a");t.href=this.mapToParam(Email.LINK_URL,o),t.target="_blank",t.click(),setTimeout(function(){return n.onComplete(!0,null)},1e3)},Email.LINK_URL="mailto:",Email);function Email(){return null!==t&&t.apply(this,arguments)||this}exports.default=o;