mirror of
https://github.com/discourse/discourse.git
synced 2025-06-21 00:03:51 +08:00
We shouldn't have to redeclare tab panels in the category edit menu
This commit is contained in:
@ -5,6 +5,10 @@ export default Em.Component.extend({
|
|||||||
active: Discourse.computed.propertyEqual('selectedTab', 'tab'),
|
active: Discourse.computed.propertyEqual('selectedTab', 'tab'),
|
||||||
title: Discourse.computed.i18n('tab', 'category.%@'),
|
title: Discourse.computed.i18n('tab', 'category.%@'),
|
||||||
|
|
||||||
|
_insertInParent: function() {
|
||||||
|
this.get('parentView.panels').addObject(this.get('tab'));
|
||||||
|
}.on('didInsertElement'),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
select: function() {
|
select: function() {
|
||||||
this.set('selectedTab', this.get('tab'));
|
this.set('selectedTab', this.get('tab'));
|
||||||
|
@ -8,12 +8,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
{{view 'edit-category-panel' tab="general" className="general-tab"}}
|
{{#each tab in view.panels}}
|
||||||
{{#unless isUncategorizedCategory}}
|
{{view 'edit-category-panel' tab=tab}}
|
||||||
{{view 'edit-category-panel' tab="security" className="options-tab"}}
|
{{/each}}
|
||||||
{{view 'edit-category-panel' tab="settings" className="options-tab"}}
|
|
||||||
{{/unless}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class='btn btn-primary' {{bind-attr disabled="disabled"}} {{action saveCategory}}>{{buttonTitle}}</button>
|
<button class='btn btn-primary' {{bind-attr disabled="disabled"}} {{action saveCategory}}>{{buttonTitle}}</button>
|
||||||
{{#if can_delete}}
|
{{#if can_delete}}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
export default Em.View.extend({
|
export default Em.View.extend({
|
||||||
classNameBindings: [':modal-tab', 'invisible'],
|
classNameBindings: [':modal-tab', 'invisible'],
|
||||||
|
|
||||||
invisible: Discourse.computed.propertyNotEqual('controller.selectedTab', 'tab'),
|
invisible: Discourse.computed.propertyNotEqual('controller.selectedTab', 'tab'),
|
||||||
|
|
||||||
templateName: function() {
|
templateName: function() {
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
export default Discourse.ModalBodyView.extend({
|
export default Discourse.ModalBodyView.extend({
|
||||||
templateName: 'modal/edit-category'
|
templateName: 'modal/edit-category',
|
||||||
|
|
||||||
|
_initializePanels: function() {
|
||||||
|
this.set('panels', []);
|
||||||
|
}.on('init')
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user