Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-webui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
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
caosdb
Software
caosdb-webui
Commits
e0939561
Commit
e0939561
authored
2 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Add function for creating a form modal HTML element
parent
cea7829f
No related branches found
No related tags found
2 merge requests
!103
Quick main-release of documentation
,
!97
F form helpers
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/js/form_elements.js
+31
-0
31 additions, 0 deletions
src/core/js/form_elements.js
with
31 additions
and
0 deletions
src/core/js/form_elements.js
+
31
−
0
View file @
e0939561
...
...
@@ -1563,6 +1563,37 @@ var form_elements = new function () {
}
}
/**
* Return a modal HTML element containing the given form.
*
* @param {HTMLElement} form - the form to be shown in the modal
* @param {string} title - the title of the form modal
* @param {string} explanation_text - An optional paragraph shown between
* modal title and form.
*/
this
.
make_for_modal
=
function
(
form
,
title
,
explanation_text
)
{
const
modal
=
$
(
`
<div class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">
${
title
}
</h4>
<p>{explanation_text}</p>
<button type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close">
</button>
</div>
<div class="modal-body">
</div>
</div>
</div>`
);
modal
.
find
(
"
.modal-body
"
).
append
(
form
);
return
modal
[
0
];
}
/**
* Return an input and a label, wrapped in a div with class
...
...
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