Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Diel
Stud.IP
Commits
00b4eea8
Commit
00b4eea8
authored
2 years ago
by
Jan-Hendrik Willms
Committed by
Jan-Hendrik Willms
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
check validity of forms before proceeding, fixes #772
Closes #772 Merge request
studip/studip!412
parent
f0e79924
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resources/assets/javascripts/lib/dialog.js
+10
-2
10 additions, 2 deletions
resources/assets/javascripts/lib/dialog.js
with
10 additions
and
2 deletions
resources/assets/javascripts/lib/dialog.js
+
10
−
2
View file @
00b4eea8
...
@@ -667,9 +667,17 @@ Dialog.removeHeaderHandler = function (header) {
...
@@ -667,9 +667,17 @@ Dialog.removeHeaderHandler = function (header) {
};
};
Dialog
.
initialize
=
function
()
{
Dialog
.
initialize
=
function
()
{
function
checkValidity
(
element
)
{
const
form
=
element
.
closest
(
'
form
'
);
if
(
form
===
null
)
{
return
true
;
}
return
form
.
checkValidity
();
}
// Actual dialog handler
// Actual dialog handler
function
dialogHandler
(
event
)
{
function
dialogHandler
(
event
)
{
if
(
!
event
.
isDefaultPrevented
())
{
if
(
!
event
.
isDefaultPrevented
()
&&
checkValidity
(
event
.
target
)
)
{
var
target
=
$
(
event
.
target
).
closest
(
'
[data-dialog]
'
);
var
target
=
$
(
event
.
target
).
closest
(
'
[data-dialog]
'
);
var
options
=
target
.
data
().
dialog
;
var
options
=
target
.
data
().
dialog
;
if
(
Dialog
.
fromElement
(
target
,
parseOptions
(
options
)))
{
if
(
Dialog
.
fromElement
(
target
,
parseOptions
(
options
)))
{
...
@@ -679,7 +687,7 @@ Dialog.initialize = function() {
...
@@ -679,7 +687,7 @@ Dialog.initialize = function() {
}
}
function
clickHandler
(
event
)
{
function
clickHandler
(
event
)
{
if
(
!
event
.
isDefaultPrevented
())
{
if
(
!
event
.
isDefaultPrevented
()
&&
checkValidity
(
event
.
target
)
)
{
var
element
=
$
(
event
.
target
).
closest
(
'
:submit,input[type="image"]
'
);
var
element
=
$
(
event
.
target
).
closest
(
'
:submit,input[type="image"]
'
);
var
form
=
element
.
closest
(
'
form
'
);
var
form
=
element
.
closest
(
'
form
'
);
var
action
=
element
.
attr
(
'
formaction
'
);
var
action
=
element
.
attr
(
'
formaction
'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment