This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/header-dropdown.js.es6
Sam e13ed24122 FEATURE: on mobile take users to full page search
UX: improve styling on full page search page
FEATURE: allow search context in full page search
FEATURE: visited color link for full page search
FIX: broken search help on fulls page search page
FEATURE: allow preload store to return a null
FEATURE: "mobileAction" for the header buttons
2015-09-08 11:04:03 +10:00

31 lines
744 B
JavaScript

import computed from 'ember-addons/ember-computed-decorators';
export default Ember.Component.extend({
tagName: 'li',
classNameBindings: [':header-dropdown-toggle', 'active'],
@computed('showUser')
href(showUser) {
return showUser ? this.currentUser.get('path') : '';
},
active: Ember.computed.alias('toggleVisible'),
actions: {
toggle() {
if (Discourse.Mobile.mobileView && this.get('mobileAction')) {
this.sendAction('mobileAction');
return;
}
if (this.siteSettings.login_required && !this.currentUser) {
this.sendAction('loginAction');
} else {
this.toggleProperty('toggleVisible');
}
this.appEvents.trigger('dropdowns:closeAll');
}
}
});