distraction.party/priv/static/packs/features/account_gallery.js

2 lines
4.5 KiB
JavaScript
Raw Normal View History

(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{723:function(a,e,t){"use strict";t.r(e);var r=t(1),o=t(7),n=t(0),s=t(2),c=(t(3),t(20)),i=t(26),l=t.n(i),d=t(5),p=t.n(d),u=t(27),b=t(37),h=t(291),O=t(642),j=t(644),m=t(24),f=t(156),v=t(408),g=t(22),I=t(33),y=function(c){function a(){for(var a,e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return a=c.call.apply(c,[this].concat(t))||this,Object(s.a)(Object(n.a)(Object(n.a)(a)),"state",{visible:"hide_all"!==g.f&&!a.props.media.getIn(["status","sensitive"])||"show_all"===g.f}),Object(s.a)(Object(n.a)(Object(n.a)(a)),"handleClick",function(){return!a.state.visible&&(a.setState({visible:!0}),!0)}),a}return Object(o.a)(a,c),a.prototype.render=function(){var a,e,t=this.props.media,o=this.state.visible,c=t.get("status"),n=100*(t.getIn(["meta","focus","x"])/2+.5),s=100*(t.getIn(["meta","focus","y"])/-2+.5),i={};return"gifv"===t.get("type")&&(a=Object(r.a)("span",{className:"media-gallery__gifv__label"},void 0,"GIF")),o?(i.backgroundImage="url("+t.get("preview_url")+")",i.backgroundPosition=n+"% "+s+"%"):e=Object(r.a)("span",{className:"account-gallery__item__icons"},void 0,Object(r.a)(I.a,{id:"eye-slash"})),Object(r.a)("div",{className:"account-gallery__item"},void 0,Object(r.a)(v.a,{to:"/statuses/"+c.get("id"),href:c.get("url"),style:i,onInterceptClick:this.handleClick},void 0,e,a))},a}(m.a);Object(s.a)(y,"propTypes",{media:l.a.map.isRequired});var _,L,M,w=t(911),S=t(300),k=t(654);t.d(e,"default",function(){return x});var T=function(c){function a(){for(var a,e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return a=c.call.apply(c,[this].concat(t))||this,Object(s.a)(Object(n.a)(Object(n.a)(a)),"handleLoadMore",function(){a.props.onLoadMore(a.props.maxId)}),a}return Object(o.a)(a,c),a.prototype.render=function(){return Object(r.a)(k.a,{disabled:this.props.disabled,onClick:this.handleLoadMore})},a}(m.a);Object(s.a)(T,"propTypes",{shouldUpdateScroll:p.a.func,maxId:p.a.string,onLoadMore:p.a.func.isRequired});var x=Object(c.connect)(function(a,e){return{medias:Object(f.a)(a,e.params.accountId),isLoading:a.getIn(["timelines","account:"+e.params.accountId+":media","isLoading"]),hasMore:a.getIn(["timelines","account:"+e.params.accountId+":media","hasMore"])}})((M=L=function(c){function a(){for(var o,a=arguments.length,e=new Array(a),t=0;t<a;t++)e[t]=arguments[t];return o=c.call.apply(c,[this].concat(e))||this,Object(s.a)(Object(n.a)(Object(n.a)(o)),"handleScrollToBottom",function(){o.props.hasMore&&o.handleLoadMore(0<o.props.medias.size?o.props.medias.last().getIn(["status","id"]):void 0)}),Object(s.a)(Object(n.a)(Object(n.a)(o)),"handleScroll",function(a){var e=a.target,t=e.scrollTop;e.scrollHeight-t-e.clientHeight<150&&!o.props.isLoading&&o.handleScrollToBottom()}),Object(s.a)(Object(n.a)(Object(n.a)(o)),"handleLoadMore",function(a){o.props.dispatch(Object(b.m)(o.props.params.accountId,{maxId:a}))}),Object(s.a)(Object(n.a)(Object(n.a)(o)),"handleLoadOlder",function(a){a.preventDefault(),o.handleScrollToBottom()}),o}Object(o.a)(a,c);var e=a.prototype;return e.componentDidMount=function(){this.props.dispatch(Object(u.A)(this.props.params.accountId)),this.props.dispatch(Object(b.m)(this.props.params.accountId))},e.componentWillReceiveProps=function(a){a.params.accountId!==this.props.params.accountId&&a.params.accountId&&(this.props.dispatch(Object(u.A)(a.params.accountId)),this.props.dispatch(Object(b.m)(this.props.params.accountId)))},e.render=function(){var t=this,a=this.props,o=a.medias,e=a.shouldUpdateScroll,c=a.isLoading,n=a.hasMore,s=null;return!o&&c?Object(r.a)(O.a,{},void 0,Object(r.a)(h.a,{})):(!n||c&&0===o.size||(s=Object(r.a)(k.a,{visible:!c,onClick:this.handleLoadOlder})),Object(r.a)(O.a,{},void 0,Object(r.a)(j.a,{}),Object(r.a)(S.a,{scrollKey:"account_gallery",shouldUpdateScroll:e},void 0,Object(r.a)("div",{className:"scrollable scrollable--flex",onScroll:this.handleScroll},void 0,Object(r.a)(w.a,{accountId:this.props.params.accountId}),Object(r.a)("div",{role:"feed",className:"account-gallery__container"},void 0,o.map(function(a,e){retur
//# sourceMappingURL=account_gallery.js.map