mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
We shouldn't have to redeclare tab panels in the category edit menu
This commit is contained in:
parent
386d1e231a
commit
07cb3aff97
4 changed files with 13 additions and 7 deletions
|
@ -5,6 +5,10 @@ export default Em.Component.extend({
|
|||
active: Discourse.computed.propertyEqual('selectedTab', 'tab'),
|
||||
title: Discourse.computed.i18n('tab', 'category.%@'),
|
||||
|
||||
_insertInParent: function() {
|
||||
this.get('parentView.panels').addObject(this.get('tab'));
|
||||
}.on('didInsertElement'),
|
||||
|
||||
actions: {
|
||||
select: function() {
|
||||
this.set('selectedTab', this.get('tab'));
|
||||
|
|
|
@ -8,12 +8,11 @@
|
|||
</ul>
|
||||
|
||||
<div class="modal-body">
|
||||
{{view 'edit-category-panel' tab="general" className="general-tab"}}
|
||||
{{#unless isUncategorizedCategory}}
|
||||
{{view 'edit-category-panel' tab="security" className="options-tab"}}
|
||||
{{view 'edit-category-panel' tab="settings" className="options-tab"}}
|
||||
{{/unless}}
|
||||
{{#each tab in view.panels}}
|
||||
{{view 'edit-category-panel' tab=tab}}
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class='btn btn-primary' {{bind-attr disabled="disabled"}} {{action saveCategory}}>{{buttonTitle}}</button>
|
||||
{{#if can_delete}}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
export default Em.View.extend({
|
||||
classNameBindings: [':modal-tab', 'invisible'],
|
||||
|
||||
invisible: Discourse.computed.propertyNotEqual('controller.selectedTab', 'tab'),
|
||||
|
||||
templateName: function() {
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/edit-category'
|
||||
templateName: 'modal/edit-category',
|
||||
|
||||
_initializePanels: function() {
|
||||
this.set('panels', []);
|
||||
}.on('init')
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue