about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/dropdown_menu.js
diff options
context:
space:
mode:
authorkoyu <me@koyu.space>2019-07-19 03:58:46 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-07-19 03:58:46 +0200
commit8df0022e6607e9f18bd2ba8c27f17333f5385693 (patch)
treed4e274268ad9fd391c4a404fb1fc86f9ea95b594 /app/javascript/mastodon/components/dropdown_menu.js
parentfda437a02088ac114fecb69e3b1e52f495a2dd9a (diff)
Added logout to dropdown menu (#11353)
* Added logout to dropdown menu

* Triggering build-and-test with empty commit as it seems it failed due to some internal failure

* Looks fine, ready to review

* Added changes from review

* method can be null without any problems

* Also target can be null
Diffstat (limited to 'app/javascript/mastodon/components/dropdown_menu.js')
-rw-r--r--app/javascript/mastodon/components/dropdown_menu.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/components/dropdown_menu.js b/app/javascript/mastodon/components/dropdown_menu.js
index 91b65a02f..e122515c4 100644
--- a/app/javascript/mastodon/components/dropdown_menu.js
+++ b/app/javascript/mastodon/components/dropdown_menu.js
@@ -122,11 +122,11 @@ class DropdownMenu extends React.PureComponent {
       return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
     }
 
-    const { text, href = '#' } = option;
+    const { text, href = '#', target = '_blank', method } = option;
 
     return (
       <li className='dropdown-menu__item' key={`${text}-${i}`}>
-        <a href={href} target='_blank' rel='noopener' role='button' tabIndex='0' ref={i === 0 ? this.setFocusRef : null} onClick={this.handleClick} onKeyDown={this.handleItemKeyDown} data-index={i}>
+        <a href={href} target={target} data-method={method} rel='noopener' role='button' tabIndex='0' ref={i === 0 ? this.setFocusRef : null} onClick={this.handleClick} onKeyDown={this.handleItemKeyDown} data-index={i}>
           {text}
         </a>
       </li>