Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
formtips
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
formtips
Commits
604629f3
Commit
604629f3
authored
1 year ago
by
Viktor Holovachek
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3284963
- Add support for field groups
parent
55d1355f
Branches
Branches containing commit
Tags
8.x-1.7
Tags containing commit
1 merge request
!9
Issue #3284963 - Add support for field groups
Pipeline
#91276
passed
1 year ago
Stage: build
Stage: validate
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
css/formtips.css
+4
-2
4 additions, 2 deletions
css/formtips.css
js/formtips.js
+13
-2
13 additions, 2 deletions
js/formtips.js
with
17 additions
and
4 deletions
css/formtips.css
+
4
−
2
View file @
604629f3
...
@@ -70,11 +70,13 @@ div.description.formtips-processed,
...
@@ -70,11 +70,13 @@ div.description.formtips-processed,
.formtips-processed.filter-guidelines
,
.formtips-processed.filter-guidelines
,
div
.description.formtips-processed
,
div
.description.formtips-processed
,
.form-item
.description.formtips-processed
,
.form-item
.description.formtips-processed
,
.form-item__description.formtips-processed
{
.form-item__description.formtips-processed
,
.fieldset__description.formtips-processed
{
background-color
:
#1e2021
;
background-color
:
#1e2021
;
}
}
.formtips-processed.filter-guidelines
.filter-guidelines-item
{
.formtips-processed.filter-guidelines
.filter-guidelines-item
,
.fieldset__description.formtips-processed
{
margin
:
0
;
margin
:
0
;
color
:
#fff
;
color
:
#fff
;
}
}
...
...
This diff is collapsed.
Click to expand it.
js/formtips.js
+
13
−
2
View file @
604629f3
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
selectors
=
selectors
.
join
(
'
,
'
);
selectors
=
selectors
.
join
(
'
,
'
);
}
}
var
$descriptions
=
$
(
'
.form-item .description,.form-item__description,.form-item .filter-guidelines
'
)
var
$descriptions
=
$
(
'
.form-item .description,.form-item__description,.form-item .filter-guidelines
,.fieldset__description
'
)
.
not
(
selectors
)
.
not
(
selectors
)
.
not
(
'
.formtips-processed
'
);
.
not
(
'
.formtips-processed
'
);
...
@@ -61,7 +61,8 @@
...
@@ -61,7 +61,8 @@
if
(
descriptionId
.
endsWith
(
'
-format-guidelines
'
))
{
if
(
descriptionId
.
endsWith
(
'
-format-guidelines
'
))
{
// Grab the field id from guidelines
// Grab the field id from guidelines
fieldId
=
descriptionId
.
slice
(
0
,
-
18
)
+
'
-value
'
;
fieldId
=
descriptionId
.
slice
(
0
,
-
18
)
+
'
-value
'
;
}
else
{
}
else
{
// Otherwise grabs it from the field description
// Otherwise grabs it from the field description
fieldId
=
descriptionId
.
substring
(
0
,
descriptionId
.
lastIndexOf
(
"
-
"
)
-
1
);
fieldId
=
descriptionId
.
substring
(
0
,
descriptionId
.
lastIndexOf
(
"
-
"
)
-
1
);
}
}
...
@@ -69,6 +70,16 @@
...
@@ -69,6 +70,16 @@
// First try to find a label associated with that field
// First try to find a label associated with that field
var
$label
=
$item
.
find
(
'
[for="
'
+
fieldId
+
'
"]:not(.visually-hidden)
'
);
var
$label
=
$item
.
find
(
'
[for="
'
+
fieldId
+
'
"]:not(.visually-hidden)
'
);
// Try to get the fieldset from the Field Group module.
if
(
!
$label
.
length
)
{
$label
=
$
(
'
fieldset.field-group-fieldset[id="
'
+
fieldId
+
'
"] .fieldset__label:not(.visually-hidden)
'
);
}
// Try to get the fieldset of the checkboxes element.
if
(
!
$label
.
length
)
{
$label
=
$
(
'
fieldset.fieldgroup[id="
'
+
fieldId
+
'
"] .fieldset__label:not(.visually-hidden)
'
);
}
// Try to get the label that was added as a placeholder.
// Try to get the label that was added as a placeholder.
if
(
!
$label
.
length
&&
$
(
'
#
'
+
fieldId
).
attr
(
'
placeholder
'
))
{
if
(
!
$label
.
length
&&
$
(
'
#
'
+
fieldId
).
attr
(
'
placeholder
'
))
{
$label
=
$item
.
find
(
'
[for="
'
+
fieldId
+
'
"]
'
);
$label
=
$item
.
find
(
'
[for="
'
+
fieldId
+
'
"]
'
);
...
...
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