about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/compose/components/privacy_dropdown.js
diff options
context:
space:
mode:
authorSorin Davidoi <sorin.davidoi@gmail.com>2017-05-20 14:58:13 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-05-20 14:58:13 +0200
commit2c405aed553067bfba2daf1b235a27f7ba52c956 (patch)
tree1f541b16216471732b28715ada3995489665c6e2 /app/javascript/mastodon/features/compose/components/privacy_dropdown.js
parentda0a18a318c9810fed95785c42460950b9d71183 (diff)
Performance improvements (#3168)
* refactor(components/status_list): Avoid quering scrollTop if not necessary

* refactor(components/dropdown_menu): Do not render items if not expanded

* refactor: Cherry-pick react-motion imports

* refactor(compose/privacy_dropdown): Do not render options if not open

* refactor(components/column_collapsable): Do not render children if collapsed
Diffstat (limited to 'app/javascript/mastodon/features/compose/components/privacy_dropdown.js')
-rw-r--r--app/javascript/mastodon/features/compose/components/privacy_dropdown.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js
index 1e0bb3d09..b02421949 100644
--- a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js
+++ b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js
@@ -80,7 +80,7 @@ class PrivacyDropdown extends React.PureComponent {
       <div ref={this.setRef} className={`privacy-dropdown ${open ? 'active' : ''}`}>
         <div className='privacy-dropdown__value'><IconButton className='privacy-dropdown__value-icon' icon={valueOption.icon} title={intl.formatMessage(messages.change_privacy)} size={18} active={open} inverted onClick={this.handleToggle} style={iconStyle}/></div>
         <div className='privacy-dropdown__dropdown'>
-          {options.map(item =>
+          {open && options.map(item =>
             <div role='button' tabIndex='0' key={item.value} data-index={item.value} onClick={this.handleClick} className={`privacy-dropdown__option ${item.value === value ? 'active' : ''}`}>
               <div className='privacy-dropdown__option__icon'><i className={`fa fa-fw fa-${item.icon}`} /></div>
               <div className='privacy-dropdown__option__content'>