Sane sendAction() behavior

This commit is contained in:
Kane York 2015-09-11 09:34:20 -07:00
parent f36dcb6a62
commit fc5e157395
2 changed files with 8 additions and 7 deletions

View File

@ -12,14 +12,14 @@ export default DropdownButton.extend({
dropDownContent() {
const includeReorder = this.get('siteSettings.fixed_category_positions');
const items = [
{ id: 'createCategory',
{ id: 'create',
title: I18n.t('category.create'),
description: I18n.t('category.create_long'),
styleClasses: 'fa fa-plus' }
];
if (includeReorder) {
items.push({
id: 'reorderCategories',
id: 'reorder',
title: I18n.t('categories.reorder.title'),
description: I18n.t('categories.reorder.title_long'),
styleClasses: 'fa fa-random'
@ -28,10 +28,12 @@ export default DropdownButton.extend({
return items;
},
// sendAction() is pretty silly if you ask me
actionFor_createCategory: 'createCategory',
actionFor_reorderCategories: 'reorderCategories',
actionNames: {
create: 'createCategory',
reorder: 'reorderCategories'
},
clicked(id) {
this.sendAction('actionFor_' + id);
this.sendAction('actionNames.' + id);
}
});

View File

@ -1,2 +1 @@
@import "common/admin/admin_base";
@import "common/admin/cat_reorder";