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

17 lines
394 B
JavaScript

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