2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

FIX: various issues when editing category permissions

This commit also adds multiple tests
This commit is contained in:
Joffrey JAFFEUX 2017-11-27 19:50:04 +01:00 committed by GitHub
parent c22f202e10
commit 49b1df40fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 127 additions and 12 deletions

View file

@ -61,6 +61,7 @@ export default Ember.Component.extend(UtilsMixin, PluginApiMixin, DomHelpersMixi
computedContent: null,
limitMatches: 100,
nameChanges: false,
allowsContentReplacement: false,
init() {
this._super();
@ -79,10 +80,15 @@ export default Ember.Component.extend(UtilsMixin, PluginApiMixin, DomHelpersMixi
if (this.get("nameChanges")) {
this.addObserver(`content.@each.${this.get("nameProperty")}`, this, this._compute);
}
if (this.get("allowsContentReplacement")) {
this.addObserver(`content.[]`, this, this._compute);
}
},
willDestroyElement() {
this.removeObserver(`content.@each.${this.get("nameProperty")}`, this, this._compute);
this.removeObserver(`content.[]`, this, this._compute);
},
willComputeAttributes() {},