BUGFIX: use plugin outlet instead of custom code

This commit is contained in:
Sam 2014-06-17 13:39:52 +10:00
parent 983a22004a
commit d85d34bac8
2 changed files with 1 additions and 30 deletions

View file

@ -175,7 +175,7 @@
{{preference-checkbox labelKey="user.enable_quoting" checked=enable_quoting}}
{{preference-checkbox labelKey="user.dynamic_favicon" checked=dynamic_favicon}}
{{preference-checkbox labelKey="user.disable_jump_reply" checked=disable_jump_reply}}
{{view Discourse.CustomPreferences}}
{{plugin-outlet "user_custom_preferences"}}
</div>
<div class="control-group category">

View file

@ -13,9 +13,6 @@ Discourse.PreferencesView = Discourse.View.extend({
uploading: false,
uploadProgress: 0,
customPreferences: function(){
}.property(),
didInsertElement: function() {
var self = this;
var $upload = $("#profile-background-input");
@ -56,29 +53,3 @@ Discourse.PreferencesView = Discourse.View.extend({
$("#profile-background-input").fileupload("destroy");
}
});
Discourse.PreferencesView.reopenClass({
registerCustomSection: function(viewClass){
var customSections = this.customSections;
if(!customSections){
customSections = Em.A();
this.customSections = customSections;
}
customSections.addObject(viewClass);
}
});
Discourse.CustomPreferences = Discourse.ContainerView.extend({
init: function(){
this._super();
var self = this;
var sections = Discourse.PreferencesView.customSections;
if(sections){
sections.forEach(function(view){
self.pushObject(view.create({user: self.get('controller.model')}));
});
}
}
});