added a conditional that checks if the logo_url setting is empty. In that case, the logoHTML function returns a header tag with the site_title as its content
This commit is contained in:
parent
9f3d5b9f1e
commit
132b0498ed
|
@ -87,20 +87,25 @@ Discourse.HeaderView = Discourse.View.extend({
|
|||
|
||||
/**
|
||||
Display the correct logo in the header, showing a custom small icon if it exists.
|
||||
|
||||
In case the logo_url setting is empty, shows the site title as the logo.
|
||||
@property logoHTML
|
||||
**/
|
||||
logoHTML: function() {
|
||||
var result = "<div class='title'><a href='" + Discourse.getURL("/") + "'>";
|
||||
if (this.get('controller.showExtraInfo')) {
|
||||
var logo = Discourse.SiteSettings.logo_small_url;
|
||||
if (logo && logo.length > 1) {
|
||||
result += "<img class='logo-small' src='" + logo + "' width='33' height='33'>";
|
||||
var logoSmall = Discourse.SiteSettings.logo_small_url;
|
||||
if (logoSmall && logoSmall.length > 1) {
|
||||
result += "<img class='logo-small' src='" + logoSmall + "' width='33' height='33'>";
|
||||
} else {
|
||||
result += "<i class='icon-home'></i>";
|
||||
}
|
||||
} else {
|
||||
result += "<img class='logo-big' src=\"" + Discourse.SiteSettings.logo_url + "\" alt=\"" + Discourse.SiteSettings.title + "\" id='site-logo'>";
|
||||
var logo = Discourse.SiteSettings.logo_url;
|
||||
if(logo && logo.length > 1) {
|
||||
result += "<img class='logo-big' src=\"" + logo + "\" alt=\"" + Discourse.SiteSettings.title + "\" id='site-logo'>";
|
||||
} else {
|
||||
result += "<h2 class='text-logo' id='site-text-logo'>" + Discourse.SiteSettings.title + "</h2>"
|
||||
}
|
||||
}
|
||||
result += "</a></div>";
|
||||
return new Handlebars.SafeString(result);
|
||||
|
|
Loading…
Reference in New Issue