Skip to content
Snippets Groups Projects
Commit 64d109dc authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Downsize originals in media attachments, small fixes

parent a910cdd5
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,7 @@ export function submitCompose() { ...@@ -74,7 +74,7 @@ export function submitCompose() {
// To make the app more responsive, immediately get the status into the columns // To make the app more responsive, immediately get the status into the columns
dispatch(updateTimeline('home', { ...response.data })); dispatch(updateTimeline('home', { ...response.data }));
if (response.data.in_reply_to_id === null) { if (response.data.in_reply_to_id === null && !getState().getIn(['compose', 'unlisted'])) {
dispatch(updateTimeline('public', { ...response.data })); dispatch(updateTimeline('public', { ...response.data }));
} }
}).catch(function (error) { }).catch(function (error) {
......
...@@ -129,7 +129,7 @@ const MediaGallery = React.createClass({ ...@@ -129,7 +129,7 @@ const MediaGallery = React.createClass({
return ( return (
<div key={attachment.get('id')} style={{ boxSizing: 'border-box', position: 'relative', left: left, top: top, right: right, bottom: bottom, float: 'left', border: 'none', display: 'block', width: `${width}%`, height: `${height}%` }}> <div key={attachment.get('id')} style={{ boxSizing: 'border-box', position: 'relative', left: left, top: top, right: right, bottom: bottom, float: 'left', border: 'none', display: 'block', width: `${width}%`, height: `${height}%` }}>
<a href={attachment.get('url')} onClick={this.handleClick.bind(this, attachment.get('url'))} target='_blank' style={{ display: 'block', width: '100%', height: '100%', background: `url(${attachment.get('preview_url')}) no-repeat center`, textDecoration: 'none', backgroundSize: 'cover', cursor: 'zoom-in' }} /> <a href={attachment.get('remote_url') ? attachment.get('remote_url') : attachment.get('url')} onClick={this.handleClick.bind(this, attachment.get('url'))} target='_blank' style={{ display: 'block', width: '100%', height: '100%', background: `url(${attachment.get('preview_url')}) no-repeat center`, textDecoration: 'none', backgroundSize: 'cover', cursor: 'zoom-in' }} />
</div> </div>
); );
}); });
......
...@@ -44,7 +44,7 @@ class MediaAttachment < ApplicationRecord ...@@ -44,7 +44,7 @@ class MediaAttachment < ApplicationRecord
def file_styles(f) def file_styles(f)
if f.instance.image? if f.instance.image?
{ {
original: '100%', original: '1280x1280>',
small: '510x680>', small: '510x680>',
} }
else else
......
attributes :id, :remote_url, :type attributes :id, :remote_url, :type
node(:url) { |media| full_asset_url(media.file.url( :original)) } node(:url) { |media| full_asset_url(media.file.url(:original)) }
node(:preview_url) { |media| full_asset_url(media.file.url( :small)) } node(:preview_url) { |media| full_asset_url(media.file.url(:small)) }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment