mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 13:56:50 +08:00
FIX: top_menu with category links like category/Meta are not case sensitive
This commit is contained in:
parent
49f0eaea13
commit
6c10cc3788
|
@ -29,6 +29,10 @@ Discourse.Category = Discourse.Model.extend({
|
|||
return Discourse.getURL("/category/") + Discourse.Category.slugFor(this);
|
||||
}.property('name'),
|
||||
|
||||
nameLower: function() {
|
||||
return this.get('name').toLowerCase();
|
||||
}.property('name'),
|
||||
|
||||
unreadUrl: function() {
|
||||
return this.get('url') + '/l/unread';
|
||||
}.property('url'),
|
||||
|
|
|
@ -21,7 +21,7 @@ Discourse.NavItem = Discourse.Model.extend({
|
|||
categorySlug: function() {
|
||||
var split = this.get('name').split('/');
|
||||
if (split[0] === 'category' && split[1]) {
|
||||
var cat = Discourse.Site.current().categories.findProperty('name', split[1]);
|
||||
var cat = Discourse.Site.current().categories.findProperty('nameLower', split[1].toLowerCase());
|
||||
return cat ? Discourse.Category.slugFor(cat) : null;
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user