diff options
Diffstat (limited to 'app/javascript/flavours')
7 files changed, 37 insertions, 12 deletions
diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 0ea959895..a6c08ba1c 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -262,12 +262,12 @@ export default class Status extends ImmutablePureComponent { this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`); } - handleHotkeyMoveUp = () => { - this.props.onMoveUp(this.props.containerId || this.props.id); + handleHotkeyMoveUp = e => { + this.props.onMoveUp(this.props.containerId || this.props.id, e.target.getAttribute('data-featured')); } - handleHotkeyMoveDown = () => { - this.props.onMoveDown(this.props.containerId || this.props.id); + handleHotkeyMoveDown = e => { + this.props.onMoveDown(this.props.containerId || this.props.id, e.target.getAttribute('data-featured')); } handleRef = c => { @@ -302,6 +302,7 @@ export default class Status extends ImmutablePureComponent { onOpenMedia, notification, hidden, + featured, ...other } = this.props; const { isExpanded, isCollapsed } = this.state; @@ -436,6 +437,7 @@ export default class Status extends ImmutablePureComponent { {...selectorAttribs} ref={handleRef} tabIndex='0' + data-featured={featured ? 'true' : null} > <header className='status__info'> <span> diff --git a/app/javascript/flavours/glitch/components/status_list.js b/app/javascript/flavours/glitch/components/status_list.js index ea40463da..2b35d6f3d 100644 --- a/app/javascript/flavours/glitch/components/status_list.js +++ b/app/javascript/flavours/glitch/components/status_list.js @@ -28,13 +28,25 @@ export default class StatusList extends ImmutablePureComponent { trackScroll: true, }; - handleMoveUp = id => { - const elementIndex = this.props.statusIds.indexOf(id) - 1; + getFeaturedStatusCount = () => { + return this.props.featuredStatusIds ? this.props.featuredStatusIds.size : 0; + } + + getCurrentStatusIndex = (id, featured) => { + if (featured) { + return this.props.featuredStatusIds.indexOf(id); + } else { + return this.props.statusIds.indexOf(id) + this.getFeaturedStatusCount(); + } + } + + handleMoveUp = (id, featured) => { + const elementIndex = this.getCurrentStatusIndex(id, featured) - 1; this._selectChild(elementIndex); } - handleMoveDown = id => { - const elementIndex = this.props.statusIds.indexOf(id) + 1; + handleMoveDown = (id, featured) => { + const elementIndex = this.getCurrentStatusIndex(id, featured) + 1; this._selectChild(elementIndex); } diff --git a/app/javascript/flavours/glitch/containers/dropdown_menu_container.js b/app/javascript/flavours/glitch/containers/dropdown_menu_container.js index 9d490de17..dccd93dab 100644 --- a/app/javascript/flavours/glitch/containers/dropdown_menu_container.js +++ b/app/javascript/flavours/glitch/containers/dropdown_menu_container.js @@ -14,8 +14,13 @@ const mapDispatchToProps = (dispatch, { status, items }) => ({ onOpen(id, onItemClick, dropdownPlacement) { dispatch(isUserTouching() ? openModal('ACTIONS', { status, - actions: items, - onClick: onItemClick, + actions: items.map( + (item, i) => item ? { + ...item, + name: `${item.text}-${i}`, + onClick: (e) => { return onItemClick(i, e) }, + } : null + ), }) : openDropdownMenu(id, dropdownPlacement)); }, onClose(id) { diff --git a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js index c8b040f95..9ac6dcf49 100644 --- a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js @@ -22,7 +22,6 @@ export default class ActionsModal extends ImmutablePureComponent { meta: PropTypes.node, name: PropTypes.string, on: PropTypes.bool, - onClick: PropTypes.func, onPassiveClick: PropTypes.func, text: PropTypes.node, })), diff --git a/app/javascript/flavours/glitch/styles/components/emoji.scss b/app/javascript/flavours/glitch/styles/components/emoji.scss index c91964810..dd386d698 100644 --- a/app/javascript/flavours/glitch/styles/components/emoji.scss +++ b/app/javascript/flavours/glitch/styles/components/emoji.scss @@ -1,5 +1,4 @@ .emojione { - display: inline-block; font-size: inherit; vertical-align: middle; object-fit: contain; diff --git a/app/javascript/flavours/glitch/styles/components/media.scss b/app/javascript/flavours/glitch/styles/components/media.scss index e62f64176..9d06a508e 100644 --- a/app/javascript/flavours/glitch/styles/components/media.scss +++ b/app/javascript/flavours/glitch/styles/components/media.scss @@ -302,6 +302,8 @@ video { max-width: 100% !important; max-height: 100% !important; + width: 100% !important; + height: 100% !important; } } diff --git a/app/javascript/flavours/glitch/styles/components/status.scss b/app/javascript/flavours/glitch/styles/components/status.scss index 0a022802a..2946b39e1 100644 --- a/app/javascript/flavours/glitch/styles/components/status.scss +++ b/app/javascript/flavours/glitch/styles/components/status.scss @@ -259,6 +259,12 @@ text-decoration: none; } } + &:focus > .status__content:after { + background: linear-gradient(rgba(lighten($ui-base-color, 4%), 0), rgba(lighten($ui-base-color, 4%), 1)); + } + &.status-direct> .status__content:after { + background: linear-gradient(rgba(lighten($ui-base-color, 8%), 0), rgba(lighten($ui-base-color, 8%), 1)); + } .notification__message { margin-bottom: 0; |