mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
added loader
This commit is contained in:
parent
f7e8da1f1f
commit
b35a063cd7
3 changed files with 28 additions and 6 deletions
|
@ -31,7 +31,17 @@ export class App extends React.Component {
|
|||
|
||||
mapInit = () => {
|
||||
const path = getPath();
|
||||
if (path) getStoredMap({ name: path, callback: this.editor.setData });
|
||||
if (path) getStoredMap({ name: path, callback: this.setDataOnLoad });
|
||||
};
|
||||
|
||||
setDataOnLoad = data => {
|
||||
this.editor.setData(data);
|
||||
this.hideLoader();
|
||||
};
|
||||
|
||||
hideLoader = () => {
|
||||
document.getElementById('loader').style.opacity = 0;
|
||||
document.getElementById('loader').style.pointerEvents = 'none';
|
||||
};
|
||||
|
||||
setMode = mode => {
|
||||
|
@ -101,9 +111,7 @@ export class App extends React.Component {
|
|||
storeData('user', this.state.user);
|
||||
};
|
||||
|
||||
getUserData = () => {
|
||||
return getData('user') || null;
|
||||
};
|
||||
getUserData = () => getData('user') || null;
|
||||
|
||||
userLogout = () => {
|
||||
this.setState({
|
||||
|
|
|
@ -9,9 +9,21 @@
|
|||
<link rel="shortcut icon" href="/favicon.png?wd" type="image/png">
|
||||
<meta property="og:image" content="/misc/vk_preview.png" />
|
||||
<meta content="/misc/vk_preview.png">
|
||||
<style>
|
||||
#loader {
|
||||
position: fixed;
|
||||
background: #576066;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 10;
|
||||
transition: opacity 1s;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<section id="loader"></section>
|
||||
<section id="index"></section>
|
||||
<div id="map" />
|
||||
<section id="map"></section>
|
||||
</body>
|
||||
|
|
|
@ -127,6 +127,8 @@ export class Poly {
|
|||
setPoints = latlngs => {
|
||||
if (!latlngs || latlngs.length <= 1) return;
|
||||
this.poly.setLatLngs(latlngs);
|
||||
|
||||
this.updateMarks();
|
||||
};
|
||||
|
||||
pushPoints = latlngs => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue