mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FIX: Some errors that only appear in Ember 1.13
This commit is contained in:
parent
7953a53cc5
commit
004e71a3fe
@ -3,8 +3,11 @@ import { get } from 'discourse-common/lib/raw-handlebars';
|
|||||||
// `Ember.Helper` is only available in versions after 1.12
|
// `Ember.Helper` is only available in versions after 1.12
|
||||||
export function htmlHelper(fn) {
|
export function htmlHelper(fn) {
|
||||||
if (Ember.Helper) {
|
if (Ember.Helper) {
|
||||||
return Ember.Helper.helper(function() {
|
return Ember.Helper.helper(function(...args) {
|
||||||
return new Handlebars.SafeString(fn.apply(this, Array.prototype.slice.call(arguments)) || '');
|
if (args.length > 1) {
|
||||||
|
args[1] = { hash: args[1] };
|
||||||
|
}
|
||||||
|
return new Handlebars.SafeString(fn.apply(this, args) || '');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return Ember.Handlebars.makeBoundHelper(function() {
|
return Ember.Handlebars.makeBoundHelper(function() {
|
||||||
|
@ -20,7 +20,10 @@ export default DiscoveryController.extend({
|
|||||||
@computed("model.parentCategory")
|
@computed("model.parentCategory")
|
||||||
categoryPageStyle(parentCategory) {
|
categoryPageStyle(parentCategory) {
|
||||||
const style = this.siteSettings.desktop_category_page_style;
|
const style = this.siteSettings.desktop_category_page_style;
|
||||||
return parentCategory && style === "categories_and_latest_topics" ? "categories_only" : style;
|
const componentName = (parentCategory && style === "categories_and_latest_topics") ?
|
||||||
|
"categories_only" :
|
||||||
|
style;
|
||||||
|
return Ember.String.dasherize(componentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -6,8 +6,8 @@ export default htmlHelper((user, args) => {
|
|||||||
if (!user) { return; }
|
if (!user) { return; }
|
||||||
|
|
||||||
const name = escapeExpression(user.get('name'));
|
const name = escapeExpression(user.get('name'));
|
||||||
let currentUser = args.currentUser;
|
let currentUser;
|
||||||
if (!currentUser && args.hash) {
|
if (args && args.hash) {
|
||||||
currentUser = args.hash.currentUser;
|
currentUser = args.hash.currentUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user