From 2bbd22e91cdb917bdf421d66479e97cf2428391b Mon Sep 17 00:00:00 2001 From: cwm Date: Tue, 26 Dec 2017 13:21:20 -0600 Subject: Rename settingKey to settingPath (tootsuite pr #6046 & #6098) --- .../components/column_settings.js | 2 +- .../home_timeline/components/column_settings.js | 8 +++--- .../notifications/components/column_settings.js | 32 +++++++++++----------- .../notifications/components/setting_toggle.js | 10 +++---- 4 files changed, 26 insertions(+), 26 deletions(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/community_timeline/components/column_settings.js b/app/javascript/flavours/glitch/features/community_timeline/components/column_settings.js index 6dc292ee5..aad5f3976 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/components/column_settings.js +++ b/app/javascript/flavours/glitch/features/community_timeline/components/column_settings.js @@ -26,7 +26,7 @@ export default class ColumnSettings extends React.PureComponent {
- +
); diff --git a/app/javascript/flavours/glitch/features/home_timeline/components/column_settings.js b/app/javascript/flavours/glitch/features/home_timeline/components/column_settings.js index 3ff0a1daf..d7692513e 100644 --- a/app/javascript/flavours/glitch/features/home_timeline/components/column_settings.js +++ b/app/javascript/flavours/glitch/features/home_timeline/components/column_settings.js @@ -27,21 +27,21 @@ export default class ColumnSettings extends React.PureComponent {
- } /> + } />
- } /> + } />
- } /> + } />
- +
); diff --git a/app/javascript/flavours/glitch/features/notifications/components/column_settings.js b/app/javascript/flavours/glitch/features/notifications/components/column_settings.js index 88a29d4d3..57cded4f1 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/column_settings.js +++ b/app/javascript/flavours/glitch/features/notifications/components/column_settings.js @@ -40,10 +40,10 @@ export default class ColumnSettings extends React.PureComponent {
- - {showPushSettings && } - - + + {showPushSettings && } + +
@@ -51,10 +51,10 @@ export default class ColumnSettings extends React.PureComponent {
- - {showPushSettings && } - - + + {showPushSettings && } + +
@@ -62,10 +62,10 @@ export default class ColumnSettings extends React.PureComponent {
- - {showPushSettings && } - - + + {showPushSettings && } + +
@@ -73,10 +73,10 @@ export default class ColumnSettings extends React.PureComponent {
- - {showPushSettings && } - - + + {showPushSettings && } + +
diff --git a/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js b/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js index 281359d2a..ac2211e48 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js +++ b/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js @@ -8,23 +8,23 @@ export default class SettingToggle extends React.PureComponent { static propTypes = { prefix: PropTypes.string, settings: ImmutablePropTypes.map.isRequired, - settingKey: PropTypes.array.isRequired, + settingPath: PropTypes.array.isRequired, label: PropTypes.node.isRequired, meta: PropTypes.node, onChange: PropTypes.func.isRequired, } onChange = ({ target }) => { - this.props.onChange(this.props.settingKey, target.checked); + this.props.onChange(this.props.settingPath, target.checked); } render () { - const { prefix, settings, settingKey, label, meta } = this.props; - const id = ['setting-toggle', prefix, ...settingKey].filter(Boolean).join('-'); + const { prefix, settings, settingPath, label, meta } = this.props; + const id = ['setting-toggle', prefix, ...settingPath].filter(Boolean).join('-'); return (
- + {meta && {meta}}
-- cgit From 337c2e77ee81618eb878f1ecfd570a8523d0f25c Mon Sep 17 00:00:00 2001 From: cwm Date: Tue, 26 Dec 2017 13:49:53 -0600 Subject: Fix layout for RTL (tootsuite pr #6014, #6018) --- .../glitch/features/ui/components/columns_area.js | 8 +++++-- app/javascript/flavours/glitch/styles/rtl.scss | 26 ++++++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/ui/components/columns_area.js b/app/javascript/flavours/glitch/features/ui/components/columns_area.js index 4167ff693..91d4df93f 100644 --- a/app/javascript/flavours/glitch/features/ui/components/columns_area.js +++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.js @@ -54,7 +54,10 @@ export default class ColumnsArea extends ImmutablePureComponent { if (!this.props.singleColumn) { this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents.hasSupport ? { passive: true } : false); } - this.lastIndex = getIndex(this.context.router.history.location.pathname); + + this.lastIndex = getIndex(this.context.router.history.location.pathname); + this.isRtlLayout = document.getElementsByTagName('body')[0].classList.contains('rtl'); + this.setState({ shouldAnimate: true }); } @@ -80,7 +83,8 @@ export default class ColumnsArea extends ImmutablePureComponent { handleChildrenContentChange() { if (!this.props.singleColumn) { - this._interruptScrollAnimation = scrollRight(this.node, this.node.scrollWidth - window.innerWidth); + const modifier = this.isRtlLayout ? -1 : 1; + this._interruptScrollAnimation = scrollRight(this.node, (this.node.scrollWidth - window.innerWidth) * modifier); } } diff --git a/app/javascript/flavours/glitch/styles/rtl.scss b/app/javascript/flavours/glitch/styles/rtl.scss index 67bfa8a38..f4c566936 100644 --- a/app/javascript/flavours/glitch/styles/rtl.scss +++ b/app/javascript/flavours/glitch/styles/rtl.scss @@ -7,9 +7,9 @@ body.rtl { margin-left: 5px; } - .character-counter__wrapper { - margin-right: 8px; - margin-left: 16px; + .compose-form .compose-form__buttons-wrapper .character-counter__wrapper { + margin-right: 0px; + margin-left: 4px; } .navigation-bar__profile { @@ -30,6 +30,22 @@ body.rtl { .column-header__buttons { left: 0; right: auto; + margin-left: -15px; + margin-right: 0; + } + + .column-inline-form .icon-button { + margin-left: 0; + margin-right: 5px; + } + + .column-header__links .text-btn { + margin-left: 10px; + margin-right: 0; + } + + .account__avatar-wrapper { + float: right; } .column-header__back-button { @@ -41,10 +57,6 @@ body.rtl { float: left; } - .compose-form__modifiers { - border-radius: 0 0 0 4px; - } - .setting-toggle { margin-left: 0; margin-right: 8px; -- cgit From 20ad071931ef520cdae6bf683ee52d369de8314b Mon Sep 17 00:00:00 2001 From: cwm Date: Tue, 26 Dec 2017 14:20:41 -0600 Subject: Set direction style to reply indicator (tootsuite pr #6006) --- .../glitch/features/compose/components/reply_indicator.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js index cb28e51be..3048d591b 100644 --- a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js +++ b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js @@ -6,6 +6,7 @@ import IconButton from 'flavours/glitch/components/icon_button'; import DisplayName from 'flavours/glitch/components/display_name'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import { isRtl } from 'flavours/glitch/util/rtl'; const messages = defineMessages({ cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' }, @@ -42,7 +43,10 @@ export default class ReplyIndicator extends ImmutablePureComponent { return null; } - const content = { __html: status.get('contentHtml') }; + const content = { __html: status.get('contentHtml') }; + const style = { + direction: isRtl(status.get('search_index')) ? 'rtl' : 'ltr', + }; return (
@@ -55,7 +59,7 @@ export default class ReplyIndicator extends ImmutablePureComponent {
-
+
); } -- cgit