mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
23 lines
522 B
JavaScript
23 lines
522 B
JavaScript
import Ember from 'ember';
|
|
var NProgressSaveMixin = Ember.Mixin.create({
|
|
save: function (options) {
|
|
if (options && options.disableNProgress) {
|
|
return this._super(options);
|
|
}
|
|
|
|
NProgress.start();
|
|
|
|
return this._super(options).then(function (value) {
|
|
NProgress.done();
|
|
|
|
return value;
|
|
}).catch(function (error) {
|
|
NProgress.done();
|
|
|
|
return Ember.RSVP.reject(error);
|
|
});
|
|
}
|
|
});
|
|
|
|
export default NProgressSaveMixin;
|