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() { 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);
} }
}); });

View File

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