X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=priv%2Fstatic%2Fpacks%2Fflavours%2Fglitch%2Fasync%2Faccount_gallery.js;h=a282e6ebc50325297549479c0092a0f28914ba96;hb=c3cfe87c60c1edf046cc4656e7a7704db65a9c85;hp=be3f85e30dfeb8281952fa59ac114d63925c72cd;hpb=451931d36fcf0bd953ce18d027a4fe4d7b354bc9;p=akkoma diff --git a/priv/static/packs/flavours/glitch/async/account_gallery.js b/priv/static/packs/flavours/glitch/async/account_gallery.js index be3f85e30..a282e6ebc 100644 --- a/priv/static/packs/flavours/glitch/async/account_gallery.js +++ b/priv/static/packs/flavours/glitch/async/account_gallery.js @@ -1,2 +1,2 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{718:function(a,e,t){"use strict";t.r(e);var l=t(0),n=t(2),o=t(6),s=t(1),c=t(3),i=t.n(c),r=t(21),d=t(26),p=t.n(d),u=t(5),b=t.n(u),h=t(23),m=t(34),O=t(271),j=t(625),f=t(913),g=t(25),v=t(191),I=t(317),y=t(29),_=function(c){function a(){for(var a,e=arguments.length,t=new Array(e),o=0;o0?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),"shouldUpdateScroll",(function(t,e){var a=e.location;return!(((t||{}).location||{}).state||{}).mastodonModalOpen&&!(a.state&&a.state.mastodonModalOpen)})),Object(r.a)(Object(o.a)(e),"setColumnRef",(function(t){e.column=t})),Object(r.a)(Object(o.a)(e),"handleOpenMedia",(function(t){if("video"===t.get("type"))e.props.dispatch(Object(q.d)("VIDEO",{media:t,status:t.get("status")}));else if("audio"===t.get("type"))e.props.dispatch(Object(q.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(q.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.F)(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.F)(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.isLoading,c=e.hasMore,i=e.isAccount,s=e.multiColumn,r=this.state.width;if(!i)return Object(n.a)(j.a,{},void 0,Object(n.a)(E.a,{}));if(!a&&o)return Object(n.a)(j.a,{},void 0,Object(n.a)(g.a,{}));var l=null;return!c||o&&0===a.size||(l=Object(n.a)(A.a,{visible:!o,onClick:this.handleLoadOlder})),d.a.createElement(j.a,{ref:this.setColumnRef},Object(n.a)(v.a,{onClick:this.handleHeaderClick,multiColumn:s}),Object(n.a)(N.a,{scrollKey:"account_gallery",shouldUpdateScroll:this.shouldUpdateScroll},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)(x,{attachment:e,displayWidth:r,onOpenMedia:t.handleOpenMedia},e.get("id"))})),l),o&&0===a.size&&Object(n.a)("div",{className:"scrollable__append"},void 0,Object(n.a)(g.a,{})))))},e}(y.a),Object(r.a)(k,"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}),S=D))||S}}]); //# sourceMappingURL=account_gallery.js.map \ No newline at end of file