mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 04:52:52 +08:00
DEV: Convert helpers to native class syntax (#27279)
This commit is contained in:
parent
c0abae054d
commit
0a9be3bfd8
|
@ -45,14 +45,13 @@ function routeAction(actionName, router, ...params) {
|
|||
};
|
||||
}
|
||||
|
||||
export default Helper.extend({
|
||||
router: computed({
|
||||
get() {
|
||||
return getOwner(this).lookup("router:main");
|
||||
},
|
||||
}),
|
||||
export default class RouteAction extends Helper {
|
||||
@computed
|
||||
get router() {
|
||||
return getOwner(this).lookup("router:main");
|
||||
}
|
||||
|
||||
compute([actionName, ...params]) {
|
||||
return routeAction(actionName, get(this, "router"), ...params);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import ArrayProxy from "@ember/array/proxy";
|
||||
|
||||
export default ArrayProxy.extend({
|
||||
class TopicStatusIconArrayProxy extends ArrayProxy {
|
||||
render(topic, renderIcon) {
|
||||
const renderIconIf = (conditionProp, name, key) => {
|
||||
if (!topic.get(conditionProp)) {
|
||||
|
@ -17,8 +17,10 @@ export default ArrayProxy.extend({
|
|||
}
|
||||
|
||||
this.forEach((args) => renderIconIf(...args));
|
||||
},
|
||||
}).create({
|
||||
}
|
||||
}
|
||||
|
||||
export default TopicStatusIconArrayProxy.create({
|
||||
content: [
|
||||
["is_warning", "envelope", "warning"],
|
||||
["pinned", "thumbtack", "pinned"],
|
||||
|
|
Loading…
Reference in New Issue
Block a user