mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
enabling / disabling editor from url
This commit is contained in:
parent
b35a063cd7
commit
e3e209ff65
5 changed files with 70 additions and 38 deletions
|
@ -1,2 +1,12 @@
|
|||
export const getPath = () => (window.location && window.location.pathname &&
|
||||
window.location.pathname.replace(/^\//, ''));
|
||||
|
||||
export const replacePath = url => window.history.replaceState(url, 'Редактирование маршрута', url);
|
||||
|
||||
export const getUrlData = () => {
|
||||
const url = getPath();
|
||||
|
||||
const [path, mode] = url.split('/');
|
||||
|
||||
return { path, mode };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue