From 4dc96b87ddb9d2146116a54c7031d1682b236b18 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Feb 2017 16:53:46 +0900 Subject: [PATCH] :v: --- src/web/app/common/scripts/loading.js | 21 +++++++++++++++++++++ src/web/app/common/scripts/loading.ls | 16 ---------------- 2 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 src/web/app/common/scripts/loading.js delete mode 100644 src/web/app/common/scripts/loading.ls diff --git a/src/web/app/common/scripts/loading.js b/src/web/app/common/scripts/loading.js new file mode 100644 index 000000000..fa7eafaf9 --- /dev/null +++ b/src/web/app/common/scripts/loading.js @@ -0,0 +1,21 @@ +const NProgress = require('nprogress'); +NProgress.configure({ + trickleSpeed: 500, + showSpinner: false +}); + +const root = document.getElementsByTagName('html')[0]; + +module.exports = { + start: () => { + root.classList.add('progress'); + NProgress.start(); + }, + done: () => { + root.classList.remove('progress'); + NProgress.done(); + }, + set: val => { + NProgress.set(val); + } +}; diff --git a/src/web/app/common/scripts/loading.ls b/src/web/app/common/scripts/loading.ls deleted file mode 100644 index 8ebede6db..000000000 --- a/src/web/app/common/scripts/loading.ls +++ /dev/null @@ -1,16 +0,0 @@ -NProgress = require \nprogress -NProgress.configure do - trickle-speed: 500ms - show-spinner: false - -root = document.get-elements-by-tag-name \html .0 - -module.exports = - start: ~> - root.class-list.add \progress - NProgress.start! - done: ~> - root.class-list.remove \progress - NProgress.done! - set: (val) ~> - NProgress.set val