Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
00e4e5cb
Commit
00e4e5cb
authored
Dec 18, 2019
by
bbaer
Browse files
fixes #9789 with some hiccups.
parent
42ee94bd
Pipeline
#3043
passed with stages
in 3 minutes and 29 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
javascript/src/QfqForm.js
View file @
00e4e5cb
...
...
@@ -152,11 +152,6 @@ var QfqNS = QfqNS || {};
this
.
form
.
on
(
'
form.validation.failed
'
,
this
.
validationError
);
this
.
form
.
on
(
'
form.validation.success
'
,
this
.
validationSuccess
);
// Solves problem of leaving the page without releasing locks.
window
.
onbeforeunload
=
function
(
e
)
{
that
.
releaseLock
();
};
$
(
"
.radio-inline
"
).
append
(
$
(
"
<span>
"
,
{
class
:
"
checkmark
"
,
aria
:
"
hidden
"
}));
$
(
"
.checkbox-inline
"
).
append
(
$
(
"
<span>
"
,
{
class
:
"
checkmark
"
,
aria
:
"
hidden
"
}));
$
(
"
.radio
"
).
append
(
$
(
"
<span>
"
,
{
class
:
"
checkmark
"
,
aria
:
"
hidden
"
}));
...
...
@@ -175,6 +170,32 @@ var QfqNS = QfqNS || {};
this
.
lockAcquired
=
true
;
};
n
.
QfqForm
.
prototype
.
handleUnload
=
function
(
e
)
{
var
that
=
this
;
var
alert
=
new
n
.
Alert
({
message
:
"
Do you want to save before leaving?
"
,
type
:
"
info
"
,
buttons
:
[
{
label
:
"
Yes
"
,
eventName
:
"
yes
"
},
{
label
:
"
No
"
,
eventName
:
"
no
"
},
{
label
:
"
Cancel
"
,
eventName
:
"
cancel
"
}
]
});
alert
.
on
(
'
alert.yes
'
,
function
()
{
that
.
handleSaveClick
();
that
.
releaseLock
();
});
alert
.
on
(
'
alert.no
'
,
function
()
{
that
.
releaseLock
();
});
alert
.
on
(
'
alert.cancel
'
,
function
()
{
return
false
;
});
e
.
preventDefault
();
return
null
;
};
/**
* @public
*/
...
...
@@ -575,7 +596,6 @@ var QfqNS = QfqNS || {};
};
n
.
QfqForm
.
prototype
.
callSave
=
function
(
uri
)
{
console
.
log
(
"
target:
"
+
uri
);
if
(
this
.
isFormChanged
())
{
this
.
handleSaveClick
();
this
.
goToAfterSave
=
uri
;
...
...
javascript/src/QfqPage.js
View file @
00e4e5cb
...
...
@@ -81,7 +81,7 @@ var QfqNS = QfqNS || {};
// We have to use 'pagehide'. 'unload' is too late and the ajax request is lost.
window
.
addEventListener
(
"
pagehide
"
,
(
function
(
that
)
{
return
function
()
{
that
.
qfqForm
.
releaseLock
(
false
);
that
.
qfqForm
.
releaseLock
();
};
})(
this
));
}
catch
(
e
)
{
...
...
@@ -115,6 +115,8 @@ var QfqNS = QfqNS || {};
/**
* @private
*
* Releaselock has to be handled at the pagehide event, not here
*/
n
.
QfqPage
.
prototype
.
beforeUnloadHandler
=
function
(
event
)
{
var
message
=
"
\
0/
"
;
...
...
@@ -125,8 +127,6 @@ var QfqNS = QfqNS || {};
event
.
returnValue
=
message
;
return
message
;
}
this
.
qfqForm
.
releaseLock
();
};
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment