Skip to content

Commit

Permalink
fix: #8734 make nprogress module
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Oct 9, 2020
1 parent 43589a7 commit 45e8a4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions public/src/admin/admin.js
Expand Up @@ -54,12 +54,14 @@
});

function setupNProgress() {
$(window).on('action:ajaxify.start', function () {
NProgress.set(0.7);
});
require(['nprogress'], function (NProgress) {
$(window).on('action:ajaxify.start', function () {
NProgress.set(0.7);
});

$(window).on('action:ajaxify.end', function () {
NProgress.done();
$(window).on('action:ajaxify.end', function () {
NProgress.done();
});
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/meta/js.js
Expand Up @@ -94,7 +94,6 @@ JS.scripts = {
'public/vendor/jquery/serializeObject/jquery.ba-serializeobject.min.js',
'public/vendor/jquery/deserialize/jquery.deserialize.min.js',
'public/vendor/slideout/slideout.min.js',
'node_modules/nprogress/nprogress.js',
],

// modules listed below are built (/src/modules) so they can be defined anonymously
Expand All @@ -106,6 +105,7 @@ JS.scripts = {
'zxcvbn.js': 'node_modules/zxcvbn/dist/zxcvbn.js',
ace: 'node_modules/ace-builds/src-min',
'clipboard.js': 'node_modules/clipboard/dist/clipboard.min.js',
'nprogress.js': 'node_modules/nprogress/nprogress.js',
},
};

Expand Down

0 comments on commit 45e8a4d

Please sign in to comment.