From 8266d224effd3f92317cd68020ad8155b37d90b4 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 16 Dec 2018 15:26:04 +0100 Subject: Split out is_changing_upload from is_submitting Fixes #855 --- app/javascript/flavours/glitch/features/composer/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/composer/index.js b/app/javascript/flavours/glitch/features/composer/index.js index 40eae1f53..a8f5a5c3c 100644 --- a/app/javascript/flavours/glitch/features/composer/index.js +++ b/app/javascript/flavours/glitch/features/composer/index.js @@ -81,6 +81,7 @@ function mapStateToProps (state) { focusDate: state.getIn(['compose', 'focusDate']), caretPosition: state.getIn(['compose', 'caretPosition']), isSubmitting: state.getIn(['compose', 'is_submitting']), + isChangingUpload: state.getIn(['compose', 'is_changing_upload']), isUploading: state.getIn(['compose', 'is_uploading']), layout: state.getIn(['local_settings', 'layout']), media: state.getIn(['compose', 'media_attachments']), @@ -228,6 +229,7 @@ const handlers = { onChangeText, onSubmit, isSubmitting, + isChangingUpload, isUploading, media, anyMedia, @@ -243,7 +245,7 @@ const handlers = { } // Submit disabled: - if (isSubmitting || isUploading || (!text.trim().length && !anyMedia)) { + if (isSubmitting || isUploading || isChangingUpload || (!text.trim().length && !anyMedia)) { return; } @@ -386,6 +388,7 @@ class Composer extends React.Component { anyMedia, intl, isSubmitting, + isChangingUpload, isUploading, layout, media, @@ -418,7 +421,7 @@ class Composer extends React.Component { spoilersAlwaysOn, } = this.props; - let disabledButton = isSubmitting || isUploading || (!text.trim().length && !anyMedia); + let disabledButton = isSubmitting || isUploading || isChangingUpload || (!text.trim().length && !anyMedia); return (
@@ -518,6 +521,7 @@ Composer.propTypes = { focusDate: PropTypes.instanceOf(Date), caretPosition: PropTypes.number, isSubmitting: PropTypes.bool, + isChangingUpload: PropTypes.bool, isUploading: PropTypes.bool, layout: PropTypes.string, media: ImmutablePropTypes.list, -- cgit From 30de4e4dfccfde6e8fffce40fb7c1e47b06dc3be Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 17 Dec 2018 21:32:27 +0100 Subject: [Glitch] Minor scrollable list fixes * Make sure loading indicator has enough vertical space * Respect reduce_motion setting for loading indicator Port 4ede51743e5b9121a49e9131f91cf012fab410f8 to glitch-soc --- .../flavours/glitch/features/account_gallery/index.js | 2 +- .../flavours/glitch/styles/components/index.scss | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/account_gallery/index.js b/app/javascript/flavours/glitch/features/account_gallery/index.js index 3f61af0e8..a5fa01444 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/index.js +++ b/app/javascript/flavours/glitch/features/account_gallery/index.js @@ -107,7 +107,7 @@ export default class AccountGallery extends ImmutablePureComponent { ); } - if (hasMore) { + if (hasMore && !(isLoading && medias.size === 0)) { loadOlder = ; } diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss index 873dfa98d..8e90aa545 100644 --- a/app/javascript/flavours/glitch/styles/components/index.scss +++ b/app/javascript/flavours/glitch/styles/components/index.scss @@ -606,6 +606,7 @@ &__append { flex: 1 1 auto; position: relative; + min-height: 120px; } } @@ -992,7 +993,6 @@ transform: translateX(-50%); margin: 82px 0 0 50%; white-space: nowrap; - animation: loader-label 1.15s infinite cubic-bezier(0.215, 0.610, 0.355, 1.000); } } @@ -1001,11 +1001,20 @@ top: 50%; left: 50%; transform: translate(-50%, -50%); - width: 0; - height: 0; + width: 42px; + height: 42px; box-sizing: border-box; + background-color: transparent; border: 0 solid lighten($ui-base-color, 26%); + border-width: 6px; border-radius: 50%; +} + +.no-reduce-motion .loading-indicator span { + animation: loader-label 1.15s infinite cubic-bezier(0.215, 0.610, 0.355, 1.000); +} + +.no-reduce-motion .loading-indicator__figure { animation: loader-figure 1.15s infinite cubic-bezier(0.215, 0.610, 0.355, 1.000); } -- cgit From 36d27e289177fdec5332539c94b8192022a412f2 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 17 Dec 2018 21:42:18 +0100 Subject: Sandbox toot embeds in the embed modal It should not be necessary thanks to our Content Security Policy, but best be sure in case a server's CSP is incorrect. Also, avoids a CSP warning about loading remote scripts. --- app/javascript/flavours/glitch/features/ui/components/embed_modal.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/ui/components/embed_modal.js b/app/javascript/flavours/glitch/features/ui/components/embed_modal.js index f3553f4a9..bf29b0da5 100644 --- a/app/javascript/flavours/glitch/features/ui/components/embed_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/embed_modal.js @@ -74,6 +74,7 @@ export default class EmbedModal extends ImmutablePureComponent { className='embed-modal__iframe' frameBorder='0' ref={this.setIframeRef} + sandbox='allow-same-origin' title='preview' />
-- cgit