X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=priv%2Fstatic%2Fpacks%2Ffeatures%2Faccount_gallery.js;h=6afdba220a5b55cceaee04cb9e6d958e47467dd6;hb=283fb1e05bcd34294ea7bdedab62b0cc6f88d742;hp=b6fcf1a434720bb52b350bc90a7350f1d48bb1f2;hpb=fe2759bc9f2dad044b49f4954693ac09f9368041;p=akkoma diff --git a/priv/static/packs/features/account_gallery.js b/priv/static/packs/features/account_gallery.js index b6fcf1a43..6afdba220 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],{863:function(t,e,a){"use strict";a.r(e),a.d(e,"default",(function(){return z}));var n=a(0),o=a(2),c=a(9),i=a(6),s=a(8),r=a(1),l=a(3),d=a.n(l),p=a(15),u=a(16),h=a.n(u),b=a(5),m=a.n(b),f=a(26),O=a(36),g=a(306),j=a(757),v=a(764),y=a(21),_=a(210),I=a(215),M=a(14),L=a.n(M),w=a(27),R=a(22),x=a(120);var S=function(t){Object(s.a)(a,t);var e;e=a;function a(){for(var e,a=arguments.length,n=new Array(a),c=0;c0?e.props.attachments.last().getIn(["status","id"]):void 0)})),Object(r.a)(Object(o.a)(e),"handleScroll",(function(t){var a=t.target,n=a.scrollTop;150>a.scrollHeight-n-a.clientHeight&&!e.props.isLoading&&e.handleScrollToBottom()})),Object(r.a)(Object(o.a)(e),"handleLoadMore",(function(t){e.props.dispatch(Object(O.p)(e.props.params.accountId,{maxId:t}))})),Object(r.a)(Object(o.a)(e),"handleLoadOlder",(function(t){t.preventDefault(),e.handleScrollToBottom()})),Object(r.a)(Object(o.a)(e),"handleOpenMedia",(function(t){if("video"===t.get("type"))e.props.dispatch(Object(E.d)("VIDEO",{media:t,status:t.get("status")}));else if("audio"===t.get("type"))e.props.dispatch(Object(E.d)("AUDIO",{media:t,status:t.get("status")}));else{var a=t.getIn(["status","media_attachments"]),n=a.findIndex((function(e){return e.get("id")===t.get("id")}));e.props.dispatch(Object(E.d)("MEDIA",{media:a,index:n,status:t.get("status")}))}})),Object(r.a)(Object(o.a)(e),"handleRef",(function(t){t&&e.setState({width:t.offsetWidth})})),e}var a=e.prototype;return a.componentDidMount=function(){this.props.dispatch(Object(f.A)(this.props.params.accountId)),this.props.dispatch(Object(O.p)(this.props.params.accountId))},a.componentWillReceiveProps=function(t){t.params.accountId!==this.props.params.accountId&&t.params.accountId&&(this.props.dispatch(Object(f.A)(t.params.accountId)),this.props.dispatch(Object(O.p)(this.props.params.accountId)))},a.render=function(){var t=this,e=this.props,a=e.attachments,o=e.shouldUpdateScroll,c=e.isLoading,i=e.hasMore,s=e.isAccount,r=e.multiColumn,l=this.state.width;if(!s)return Object(n.a)(j.a,{},void 0,Object(n.a)(q.a,{}));if(!a&&c)return Object(n.a)(j.a,{},void 0,Object(n.a)(g.a,{}));var p=null;return!i||c&&0===a.size||(p=Object(n.a)(k.a,{visible:!c,onClick:this.handleLoadOlder})),Object(n.a)(j.a,{},void 0,Object(n.a)(v.a,{multiColumn:r}),Object(n.a)(A.a,{scrollKey:"account_gallery",shouldUpdateScroll:o},void 0,Object(n.a)("div",{className:"scrollable scrollable--flex",onScroll:this.handleScroll},void 0,Object(n.a)(T.a,{accountId:this.props.params.accountId}),d.a.createElement("div",{role:"feed",className:"account-gallery__container",ref:this.handleRef},a.map((function(e,o){return null===e?Object(n.a)(W,{maxId:o>0?a.getIn(o-1,"id"):null,onLoadMore:t.handleLoadMore},"more:"+a.getIn(o+1,"id")):Object(n.a)(S,{attachment:e,displayWidth:l,onOpenMedia:t.handleOpenMedia},e.get("id"))})),p),c&&0===a.size&&Object(n.a)("div",{className:"scrollable__append"},void 0,Object(n.a)(g.a,{})))))},e}(y.a),Object(r.a)(C,"propTypes",{params:m.a.object.isRequired,dispatch:m.a.func.isRequired,attachments:h.a.list.isRequired,isLoading:m.a.bool,hasMore:m.a.bool,isAccount:m.a.bool,multiColumn:m.a.bool}),D=N))||D}}]); //# sourceMappingURL=account_gallery.js.map \ No newline at end of file