diff options
author | unarist <m.unarist@gmail.com> | 2017-05-22 21:57:50 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-05-22 14:57:50 +0200 |
commit | 07af8c05fd65eb705bfbeadf6727cf0f72c79f20 (patch) | |
tree | a6b983617b2c0da99395bdea2f740bae33de078b /app/javascript | |
parent | aa662cecada500b57d8959f311a2a74e41e6211a (diff) |
Fix "Edit profile" on the account action bar (#3222)
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/mastodon/components/dropdown_menu.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/mastodon/components/dropdown_menu.js b/app/javascript/mastodon/components/dropdown_menu.js index ea8606626..4fe4db313 100644 --- 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); } |