Skip to content

Commit

Permalink
[Backoffice] Add page loading progress bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoUseFreak committed Oct 24, 2015
1 parent 0c3bb0d commit 3a84954
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/Clastic/BackofficeBundle/Resources/public/scripts/nprogress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

(function(){
NProgress.start();

var progress = window.setInterval(function() {
NProgress.inc(0.1);
console.log('loading');
}, 250);

$(window).on('load', function() {
clearInterval(progress);
NProgress.done();
})
})();

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
@import 'bootstrap';
@import 'font-awesome';
@import (less) '@{vendor_path}/nprogress/nprogress.css';

/**
* Common
Expand Down
1 change: 1 addition & 0 deletions src/Clastic/BackofficeBundle/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"ckeditor": "~4.4.6",
"select2": "~4.0.0",
"parsleyjs": "~2.0.6",
"nprogress": "~0.2.0",
"bootstrap-datepicker": "~1.3.1"
},
"ignore": [],
Expand Down
3 changes: 2 additions & 1 deletion src/Clastic/BackofficeBundle/clastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = function() {
new global.Clastic.GulpScript('web/vendor/select2/dist/js/select2.min.js', 'vendor', {weight: 10}),
new global.Clastic.GulpScript('web/vendor/parsleyjs/dist/parsley.min.js', 'vendor', {weight: 10}),
new global.Clastic.GulpScript('web/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js', 'vendor', {weight: 10}),
new global.Clastic.GulpScript('web/vendor/jstree/dist/jstree.min.js', 'vendor', {weight: 10})
new global.Clastic.GulpScript('web/vendor/jstree/dist/jstree.min.js', 'vendor', {weight: 10}),
new global.Clastic.GulpScript('web/vendor/nprogress/nprogress.js', 'vendor', {weight: 10})
];
};

0 comments on commit 3a84954

Please sign in to comment.