X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=priv%2Fstatic%2Fpacks%2Ffeatures%2Faccount_gallery.js;h=19dbf1fec1ae618a1185fb900218288cdf2159b6;hb=4c02e049358441529c54a72cd11f1c81ee897d49;hp=b6fcf1a434720bb52b350bc90a7350f1d48bb1f2;hpb=f2727e23eeb66c8f53d06013c28fef313a5527de;p=akkoma diff --git a/priv/static/packs/features/account_gallery.js b/priv/static/packs/features/account_gallery.js index b6fcf1a43..19dbf1fec 100644 --- a/priv/static/packs/features/account_gallery.js +++ b/priv/static/packs/features/account_gallery.js @@ -1,2 +1,2 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{704:function(a,t,o){"use strict";o.r(t);var e,n,s,r,i,c,d,l=o(0),p=o.n(l),u=o(6),h=o.n(u),m=o(3),f=o.n(m),g=o(7),v=o.n(g),I=(o(1),o(12)),y=o(17),b=o.n(y),L=o(2),_=o.n(L),M=o(13),k=o(19),S=o(194),w=o(193),O=o(196),j=o(18),T=o(32),N=o(71),R=o(10),q=(n=e=function(a){function t(){var o,e,n;h()(this,t);for(var s=arguments.length,r=Array(s),i=0;it.scrollHeight-o-t.clientHeight&&!e.props.isLoading&&e.handleScrollToBottom()},e.handleLoadMore=function(a){e.props.dispatch(Object(k.k)(e.props.params.accountId,{maxId:a}))},e.handleLoadOlder=function(a){a.preventDefault(),e.handleScrollToBottom()},n=o,f()(e,n)}return v()(t,a),t.prototype.componentDidMount=function(){this.props.dispatch(Object(M.w)(this.props.params.accountId)),this.props.dispatch(Object(k.k)(this.props.params.accountId))},t.prototype.componentWillReceiveProps=function(a){a.params.accountId!==this.props.params.accountId&&a.params.accountId&&(this.props.dispatch(Object(M.w)(a.params.accountId)),this.props.dispatch(Object(k.k)(this.props.params.accountId)))},t.prototype.render=function(){var a=this.props,t=a.medias,o=a.shouldUpdateScroll,e=a.isLoading,n=a.hasMore,s=null;return!t&&e?p()(w.a,{},void 0,p()(S.a,{})):(!e&&t.size>0&&n&&(s=p()(A.a,{onClick:this.handleLoadOlder})),p()(w.a,{},void 0,p()(O.a,{}),p()(C.a,{scrollKey:"account_gallery",shouldUpdateScroll:o},void 0,p()("div",{className:"scrollable",onScroll:this.handleScroll},void 0,p()(x.a,{accountId:this.props.params.accountId}),p()("div",{className:"account-gallery__container"},void 0,t.map(function(a,o){return null===a?p()(B,{maxId:o>0?t.getIn(o-1,"id"):null},"more:"+t.getIn(o+1,"id")):p()(q,{media:a},a.get("id"))}),s)))))},t}(j.a),c.propTypes={params:_.a.object.isRequired,dispatch:_.a.func.isRequired,medias:b.a.list.isRequired,isLoading:_.a.bool,hasMore:_.a.bool},i=d))||i}}]); +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{837:function(e,t,a){"use strict";a.r(t);var o=a(0),n=a(2),i=a(7),c=a(1),s=a(3),r=a.n(s),l=a(13),d=a(14),p=a.n(d),u=a(5),h=a.n(u),b=a(25),m=a(33),O=a(300),g=a(731),f=a(738),j=a(18),v=a(206),y=a(211),_=a(12),I=a.n(_),M=a(26),L=a(20),w=a(116),x=function(e){function t(){for(var t,a=arguments.length,o=new Array(a),i=0;i0?t.props.attachments.last().getIn(["status","id"]):void 0)})),Object(c.a)(Object(n.a)(t),"handleScroll",(function(e){var a=e.target,o=a.scrollTop;150>a.scrollHeight-o-a.clientHeight&&!t.props.isLoading&&t.handleScrollToBottom()})),Object(c.a)(Object(n.a)(t),"handleLoadMore",(function(e){t.props.dispatch(Object(m.p)(t.props.params.accountId,{maxId:e}))})),Object(c.a)(Object(n.a)(t),"handleLoadOlder",(function(e){e.preventDefault(),t.handleScrollToBottom()})),Object(c.a)(Object(n.a)(t),"handleOpenMedia",(function(e){if("video"===e.get("type"))t.props.dispatch(Object(k.d)("VIDEO",{media:e,status:e.get("status")}));else if("audio"===e.get("type"))t.props.dispatch(Object(k.d)("AUDIO",{media:e,status:e.get("status")}));else{var a=e.getIn(["status","media_attachments"]),o=a.findIndex((function(t){return t.get("id")===e.get("id")}));t.props.dispatch(Object(k.d)("MEDIA",{media:a,index:o,status:e.get("status")}))}})),Object(c.a)(Object(n.a)(t),"handleRef",(function(e){e&&t.setState({width:e.offsetWidth})})),t}Object(i.a)(t,e);var a=t.prototype;return a.componentDidMount=function(){this.props.dispatch(Object(b.A)(this.props.params.accountId)),this.props.dispatch(Object(m.p)(this.props.params.accountId))},a.componentWillReceiveProps=function(e){e.params.accountId!==this.props.params.accountId&&e.params.accountId&&(this.props.dispatch(Object(b.A)(e.params.accountId)),this.props.dispatch(Object(m.p)(this.props.params.accountId)))},a.render=function(){var e=this,t=this.props,a=t.attachments,n=t.shouldUpdateScroll,i=t.isLoading,c=t.hasMore,s=t.isAccount,l=t.multiColumn,d=this.state.width;if(!s)return Object(o.a)(g.a,{},void 0,Object(o.a)(D.a,{}));if(!a&&i)return Object(o.a)(g.a,{},void 0,Object(o.a)(O.a,{}));var p=null;return!c||i&&0===a.size||(p=Object(o.a)(A.a,{visible:!i,onClick:this.handleLoadOlder})),Object(o.a)(g.a,{},void 0,Object(o.a)(f.a,{multiColumn:l}),Object(o.a)(T.a,{scrollKey:"account_gallery",shouldUpdateScroll:n},void 0,Object(o.a)("div",{className:"scrollable scrollable--flex",onScroll:this.handleScroll},void 0,Object(o.a)(N.a,{accountId:this.props.params.accountId}),r.a.createElement("div",{role:"feed",className:"account-gallery__container",ref:this.handleRef},a.map((function(t,n){return null===t?Object(o.a)(q,{maxId:n>0?a.getIn(n-1,"id"):null,onLoadMore:e.handleLoadMore},"more:"+a.getIn(n+1,"id")):Object(o.a)(x,{attachment:t,displayWidth:d,onOpenMedia:e.handleOpenMedia},t.get("id"))})),p),i&&0===a.size&&Object(o.a)("div",{className:"scrollable__append"},void 0,Object(o.a)(O.a,{})))))},t}(j.a),Object(c.a)(S,"propTypes",{params:h.a.object.isRequired,dispatch:h.a.func.isRequired,attachments:p.a.list.isRequired,isLoading:h.a.bool,hasMore:h.a.bool,isAccount:h.a.bool,multiColumn:h.a.bool}),R=C))||R}}]); //# sourceMappingURL=account_gallery.js.map \ No newline at end of file