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/home-logo.js.es6
2015-08-13 10:49:08 -04:00

34 lines
890 B
JavaScript

import DiscourseURL from 'discourse/lib/url';
import { setting } from 'discourse/lib/computed';
export default Ember.Component.extend({
classNames: ["title"],
linkUrl: function() {
return Discourse.getURL('/');
}.property(),
showSmallLogo: function() {
return !Discourse.Mobile.mobileView && this.get("minimized");
}.property("minimized"),
showMobileLogo: function() {
return Discourse.Mobile.mobileView && !Ember.isBlank(this.get('mobileBigLogoUrl'));
}.property(),
smallLogoUrl: setting('logo_small_url'),
bigLogoUrl: setting('logo_url'),
mobileBigLogoUrl: setting('mobile_logo_url'),
title: setting('title'),
click: function(e) {
// if they want to open in a new tab, let it so
if (e.shiftKey || e.metaKey || e.ctrlKey || e.which === 2) { return true; }
e.preventDefault();
DiscourseURL.routeTo('/');
return false;
}
});