about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-04-23 23:42:29 +0200
committerGitHub <noreply@github.com>2018-04-23 23:42:29 +0200
commit65b8880ec99953969197c63f5396c7da0a6a6c55 (patch)
tree3ce6d32a92981901954f4d9fd8e2f91fd94bdb47 /app/javascript/flavours/glitch
parent06fc278e4cfad385ba1ffd672c8c43a800f49bc3 (diff)
parent240833c023590b6fa442c153fae8c9036559b3f4 (diff)
Merge pull request #442 from ThibG/glitch-soc/fixes/actions-modal-mobile
Fix actions modal on mobile (fixes #441)
Diffstat (limited to 'app/javascript/flavours/glitch')
-rw-r--r--app/javascript/flavours/glitch/containers/dropdown_menu_container.js9
-rw-r--r--app/javascript/flavours/glitch/features/ui/components/actions_modal.js1
2 files changed, 7 insertions, 3 deletions
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,
     })),