mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
clearing changed on cleared all
This commit is contained in:
parent
3363708c1f
commit
bed9ea6948
3 changed files with 17 additions and 5 deletions
|
@ -63,14 +63,14 @@ export class App extends React.Component {
|
||||||
|
|
||||||
this.hideLoader();
|
this.hideLoader();
|
||||||
|
|
||||||
this.setState({ changed: false });
|
this.clearChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
setTitle = title => this.setState({ title });
|
setTitle = title => this.setState({ title });
|
||||||
setAddress = address => this.setState({ address });
|
setAddress = address => this.setState({ address });
|
||||||
|
|
||||||
setDataOnLoad = data => {
|
setDataOnLoad = data => {
|
||||||
this.setState({ changed: false });
|
this.clearChanged();
|
||||||
this.editor.setData(data);
|
this.editor.setData(data);
|
||||||
this.hideLoader();
|
this.hideLoader();
|
||||||
};
|
};
|
||||||
|
@ -114,6 +114,11 @@ export class App extends React.Component {
|
||||||
this.setState({ changed: true });
|
this.setState({ changed: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
clearChanged = () => {
|
||||||
|
console.log('clearing');
|
||||||
|
this.setState({ changed: false });
|
||||||
|
};
|
||||||
|
|
||||||
editor = new Editor({
|
editor = new Editor({
|
||||||
container: 'map',
|
container: 'map',
|
||||||
mode: this.state.mode,
|
mode: this.state.mode,
|
||||||
|
@ -127,6 +132,7 @@ export class App extends React.Component {
|
||||||
setAddress: this.setAddress,
|
setAddress: this.setAddress,
|
||||||
getUser: this.getUser,
|
getUser: this.getUser,
|
||||||
triggerOnChange: this.triggerOnChange,
|
triggerOnChange: this.triggerOnChange,
|
||||||
|
clearChanged: this.clearChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
authInit = () => {
|
authInit = () => {
|
||||||
|
|
|
@ -23,6 +23,7 @@ export class Editor {
|
||||||
setAddress,
|
setAddress,
|
||||||
getUser,
|
getUser,
|
||||||
triggerOnChange,
|
triggerOnChange,
|
||||||
|
clearChanged,
|
||||||
}) {
|
}) {
|
||||||
this.logo = DEFAULT_LOGO;
|
this.logo = DEFAULT_LOGO;
|
||||||
this.owner = null;
|
this.owner = null;
|
||||||
|
@ -57,6 +58,9 @@ export class Editor {
|
||||||
},
|
},
|
||||||
[MODES.TRASH]: {
|
[MODES.TRASH]: {
|
||||||
toggle: this.clearAll,
|
toggle: this.clearAll,
|
||||||
|
},
|
||||||
|
[MODES.CONFIRM_CANCEL]: {
|
||||||
|
toggle: this.stopEditing,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -66,6 +70,7 @@ export class Editor {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.activeSticker = null;
|
this.activeSticker = null;
|
||||||
|
this.clearChanged = clearChanged;
|
||||||
this.setActiveSticker = setActiveSticker;
|
this.setActiveSticker = setActiveSticker;
|
||||||
this.setLogo = setLogo;
|
this.setLogo = setLogo;
|
||||||
this.setMode = setMode;
|
this.setMode = setMode;
|
||||||
|
@ -170,6 +175,8 @@ export class Editor {
|
||||||
|
|
||||||
this.setSticker(null);
|
this.setSticker(null);
|
||||||
this.changeMode(MODES.NONE);
|
this.changeMode(MODES.NONE);
|
||||||
|
|
||||||
|
this.clearChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
changeLogo = logo => {
|
changeLogo = logo => {
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: ' ';
|
content: ' ';
|
||||||
box-shadow: 0 0 10px 1px @red_secondary;
|
|
||||||
background: @red_secondary;
|
background: @red_secondary;
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
@ -19,8 +18,8 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
transform: scale(0.5);
|
||||||
transition: opacity 250ms, transform 500ms;
|
transition: opacity 250ms, transform 500ms;
|
||||||
transform: scale(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover, &:active {
|
&:hover, &:active {
|
||||||
|
@ -30,7 +29,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
opacity: 1;
|
opacity: 0.3;
|
||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue