mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 07:39:41 +02:00
Vue-ify and add documentation
This commit is contained in:
parent
dd5d1b9cba
commit
265313919c
1 changed files with 17 additions and 2 deletions
|
@ -1,7 +1,22 @@
|
|||
export const activateNavigationWarning = () => {
|
||||
export function useNavigationWarning() {
|
||||
return { activateNavigationWarning, deactivateNavigationWarning };
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a warning before the user navigates to another page
|
||||
* e.g., by clicking a link (which isn't internal and rendered without page load),
|
||||
* reloading the page,
|
||||
* or closing the tab.
|
||||
*/
|
||||
const activateNavigationWarning = () => {
|
||||
console.log("ACTIVATE");
|
||||
window.onbeforeunload = () => true;
|
||||
}
|
||||
|
||||
export const deactivateNavigationWarning = () => {
|
||||
/**
|
||||
* Disables the warning when navigating to a page
|
||||
*/
|
||||
const deactivateNavigationWarning = () => {
|
||||
console.log("deACTIVATE");
|
||||
window.onbeforeunload = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue