mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 14:22:52 +08:00
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.
|
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
|
@property logoHTML
|
||||||
**/
|
**/
|
||||||
logoHTML: function() {
|
logoHTML: function() {
|
||||||
var result = "<div class='title'><a href='" + Discourse.getURL("/") + "'>";
|
var result = "<div class='title'><a href='" + Discourse.getURL("/") + "'>";
|
||||||
if (this.get('controller.showExtraInfo')) {
|
if (this.get('controller.showExtraInfo')) {
|
||||||
var logo = Discourse.SiteSettings.logo_small_url;
|
var logoSmall = Discourse.SiteSettings.logo_small_url;
|
||||||
if (logo && logo.length > 1) {
|
if (logoSmall && logoSmall.length > 1) {
|
||||||
result += "<img class='logo-small' src='" + logo + "' width='33' height='33'>";
|
result += "<img class='logo-small' src='" + logoSmall + "' width='33' height='33'>";
|
||||||
} else {
|
} else {
|
||||||
result += "<i class='icon-home'></i>";
|
result += "<i class='icon-home'></i>";
|
||||||
}
|
}
|
||||||
} else {
|
} 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>";
|
result += "</a></div>";
|
||||||
return new Handlebars.SafeString(result);
|
return new Handlebars.SafeString(result);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user