diff options
author | 2022-06-17 22:53:25 +0530 | |
---|---|---|
committer | 2022-06-17 17:23:25 +0000 | |
commit | 9b052c5345054a0f1cc879f795fd71e97a79c83e (patch) | |
tree | 264e84a790c9af9e576a1725274ea480bb7f4580 /src/app.js | |
parent | Revert "Feature: Progress Indicator for page loading (#248)" (diff) | |
download | ferdium-app-9b052c5345054a0f1cc879f795fd71e97a79c83e.tar.gz ferdium-app-9b052c5345054a0f1cc879f795fd71e97a79c83e.tar.zst ferdium-app-9b052c5345054a0f1cc879f795fd71e97a79c83e.zip |
Add a less-obstrusive progress bar on top of the Ferdium window (#285)
Diffstat (limited to 'src/app.js')
-rw-r--r-- | src/app.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/app.js b/src/app.js index c56cda241..aa140832c 100644 --- a/src/app.js +++ b/src/app.js | |||
@@ -4,6 +4,7 @@ import { render } from 'react-dom'; | |||
4 | import { Provider } from 'mobx-react'; | 4 | import { Provider } from 'mobx-react'; |
5 | import { syncHistoryWithStore, RouterStore } from 'mobx-react-router'; | 5 | import { syncHistoryWithStore, RouterStore } from 'mobx-react-router'; |
6 | import { hashHistory } from 'react-router'; | 6 | import { hashHistory } from 'react-router'; |
7 | import TopBarProgress from 'react-topbar-progress-indicator'; | ||
7 | 8 | ||
8 | import ServerApi from './api/server/ServerApi'; | 9 | import ServerApi from './api/server/ServerApi'; |
9 | import LocalApi from './api/server/LocalApi'; | 10 | import LocalApi from './api/server/LocalApi'; |
@@ -53,8 +54,8 @@ window.addEventListener('load', () => { | |||
53 | // TODO: send this request to the recipe.js | 54 | // TODO: send this request to the recipe.js |
54 | window.addEventListener('mouseup', e => { | 55 | window.addEventListener('mouseup', e => { |
55 | if (e.button === 3 || e.button === 4) { | 56 | if (e.button === 3 || e.button === 4) { |
56 | e.preventDefault() | 57 | e.preventDefault() |
57 | e.stopPropagation() | 58 | e.stopPropagation() |
58 | } | 59 | } |
59 | }); | 60 | }); |
60 | 61 | ||
@@ -63,3 +64,13 @@ window.addEventListener('dragover', event => event.preventDefault()); | |||
63 | window.addEventListener('drop', event => event.preventDefault()); | 64 | window.addEventListener('drop', event => event.preventDefault()); |
64 | window.addEventListener('dragover', event => event.stopPropagation()); | 65 | window.addEventListener('dragover', event => event.stopPropagation()); |
65 | window.addEventListener('drop', event => event.stopPropagation()); | 66 | window.addEventListener('drop', event => event.stopPropagation()); |
67 | |||
68 | TopBarProgress.config({ | ||
69 | barThickness: 4, | ||
70 | barColors: { | ||
71 | '0': '#f00', | ||
72 | '0.5': '#0f0', | ||
73 | '1.0': '#00f', | ||
74 | }, | ||
75 | shadowBlur: 5 | ||
76 | }); | ||