2013-10-08 19:39:07 +04:00
|
|
|
/*global window, document, setTimeout, Ghost, $, _, Backbone, JST, shortcut, NProgress */
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
"use strict";
|
|
|
|
NProgress.configure({ showSpinner: false });
|
|
|
|
|
2013-11-23 01:47:03 +04:00
|
|
|
Ghost.ProgressModel = Backbone.Model.extend({
|
|
|
|
|
|
|
|
// Adds in a call to start a loading bar
|
|
|
|
// This is sets up a success function which completes the loading bar
|
|
|
|
fetch : function (options) {
|
|
|
|
options = options || {};
|
|
|
|
|
|
|
|
NProgress.start();
|
|
|
|
|
|
|
|
options.success = function () {
|
|
|
|
NProgress.done();
|
|
|
|
};
|
|
|
|
|
|
|
|
return Backbone.Model.prototype.fetch.call(this, options);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
Ghost.ProgressCollection = Backbone.Collection.extend({
|
2013-10-08 19:39:07 +04:00
|
|
|
|
|
|
|
// Adds in a call to start a loading bar
|
|
|
|
// This is sets up a success function which completes the loading bar
|
|
|
|
fetch : function (options) {
|
|
|
|
options = options || {};
|
|
|
|
|
|
|
|
NProgress.start();
|
|
|
|
|
|
|
|
options.success = function () {
|
|
|
|
NProgress.done();
|
|
|
|
};
|
|
|
|
|
|
|
|
return Backbone.Collection.prototype.fetch.call(this, options);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}());
|