logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 07af8c05fd65eb705bfbeadf6727cf0f72c79f20
parent: aa662cecada500b57d8959f311a2a74e41e6211a
Author: unarist <m.unarist@gmail.com>
Date:   Mon, 22 May 2017 21:57:50 +0900

Fix "Edit profile" on the account action bar (#3222)


Diffstat:

Mapp/javascript/mastodon/components/dropdown_menu.js5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/javascript/mastodon/components/dropdown_menu.js b/app/javascript/mastodon/components/dropdown_menu.js @@ -33,11 +33,14 @@ class DropdownMenu extends React.PureComponent { const i = Number(e.currentTarget.getAttribute('data-index')); const { action, to } = this.props.items[i]; - e.preventDefault(); + // Don't call e.preventDefault() when the item uses 'href' property. + // ex. "Edit profile" on the account action bar if (typeof action === 'function') { + e.preventDefault(); action(); } else if (to) { + e.preventDefault(); this.context.router.push(to); }