mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 05:05:15 +08:00
Sane sendAction() behavior
This commit is contained in:
parent
f36dcb6a62
commit
fc5e157395
|
@ -12,14 +12,14 @@ export default DropdownButton.extend({
|
||||||
dropDownContent() {
|
dropDownContent() {
|
||||||
const includeReorder = this.get('siteSettings.fixed_category_positions');
|
const includeReorder = this.get('siteSettings.fixed_category_positions');
|
||||||
const items = [
|
const items = [
|
||||||
{ id: 'createCategory',
|
{ id: 'create',
|
||||||
title: I18n.t('category.create'),
|
title: I18n.t('category.create'),
|
||||||
description: I18n.t('category.create_long'),
|
description: I18n.t('category.create_long'),
|
||||||
styleClasses: 'fa fa-plus' }
|
styleClasses: 'fa fa-plus' }
|
||||||
];
|
];
|
||||||
if (includeReorder) {
|
if (includeReorder) {
|
||||||
items.push({
|
items.push({
|
||||||
id: 'reorderCategories',
|
id: 'reorder',
|
||||||
title: I18n.t('categories.reorder.title'),
|
title: I18n.t('categories.reorder.title'),
|
||||||
description: I18n.t('categories.reorder.title_long'),
|
description: I18n.t('categories.reorder.title_long'),
|
||||||
styleClasses: 'fa fa-random'
|
styleClasses: 'fa fa-random'
|
||||||
|
@ -28,10 +28,12 @@ export default DropdownButton.extend({
|
||||||
return items;
|
return items;
|
||||||
},
|
},
|
||||||
|
|
||||||
// sendAction() is pretty silly if you ask me
|
actionNames: {
|
||||||
actionFor_createCategory: 'createCategory',
|
create: 'createCategory',
|
||||||
actionFor_reorderCategories: 'reorderCategories',
|
reorder: 'reorderCategories'
|
||||||
|
},
|
||||||
|
|
||||||
clicked(id) {
|
clicked(id) {
|
||||||
this.sendAction('actionFor_' + id);
|
this.sendAction('actionNames.' + id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
@import "common/admin/admin_base";
|
@import "common/admin/admin_base";
|
||||||
@import "common/admin/cat_reorder";
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user