This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/mixins/buffered-content.js.es6
Robin Ward ac2f5cbdab FIX: Admin user fields weren't showing errors
Also updated it to remove deprecations and item controller
2015-07-10 12:31:30 -04:00

21 lines
502 B
JavaScript

/* global BufferedProxy: true */
export function bufferedProperty(property) {
return Ember.Mixin.create({
buffered: function() {
return Em.ObjectProxy.extend(BufferedProxy).create({
content: this.get(property)
});
}.property(property),
rollbackBuffer: function() {
this.get('buffered').discardBufferedChanges();
},
commitBuffer: function() {
this.get('buffered').applyBufferedChanges();
}
});
}
export default bufferedProperty('content');