我使用这段代码(在编辑 CSS/HTML 自定义页面的 /head 选项卡中)向菜单添加了一些额外项目,但它在最近一次更新后停止工作了——有人知道原因吗?
<script>
Discourse.ExternalNavItem = Discourse.NavItem.extend({
href : function() {
return this.get('href');
}.property('href')
});
I18n.translations.en.js.filters.first_name_here = { title: "名称", help: "再次输入名称" };
I18n.translations.en.js.filters.second_name_here = { title: "名称", help: "访问我们的……" };
I18n.translations.en.js.filters.tags = { title: "标签", help: "标签" };
Discourse.NavItem.reopenClass({
buildList : function(category, args) {
var list = this._super(category, args);
if(!category) {
list.push(Discourse.ExternalNavItem.create({href: 'http://forum.com/tags', name: 'tags'}));
list.push(Discourse.ExternalNavItem.create({href: 'https://forum.com/something', name: 'name'}));
list.push(Discourse.ExternalNavItem.create({href: 'https://forum.com/t/thread-url/193454#heading--name', name: 'name'}));
}
return list;
}
});
</script>