Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
knowledgebase-front
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
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
Applications
Knowledge Base
knowledgebase-front
Commits
0fa6ceaf
Commit
0fa6ceaf
authored
5 years ago
by
Alice Poggioli
Browse files
Options
Downloads
Patches
Plain Diff
Manage the pagination.
parent
3840dacf
No related branches found
Branches containing commit
No related tags found
2 merge requests
!38
Feature/mentor dashboard
,
!40
Feature/entrepreneur dashboard
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scripts/coopstarter.js
+11
-9
11 additions, 9 deletions
src/scripts/coopstarter.js
with
11 additions
and
9 deletions
src/scripts/coopstarter.js
+
11
−
9
View file @
0fa6ceaf
...
@@ -38,12 +38,16 @@ function refreshList(formId, listId) {
...
@@ -38,12 +38,16 @@ function refreshList(formId, listId) {
//Remove pagination when there is no resource in a step group
//Remove pagination when there is no resource in a step group
function
actualizePagination
()
{
function
actualizePagination
()
{
console
.
log
(
"
we actu
"
)
var
resources_containers
=
document
.
querySelectorAll
(
var
resources_containers
=
document
.
querySelectorAll
(
"
.resource_by_step sib-form+div
"
"
.resource_by_step sib-form+div
"
);
);
for
(
let
resources_container
of
resources_containers
)
{
for
(
let
resources_container
of
resources_containers
)
{
if
(
resources_container
.
innerHTML
===
""
)
{
if
(
resources_container
.
childElementCount
<
5
||
resources_container
.
nextSibling
.
querySelector
(
"
nav span span+span
"
).
textContent
==
1
)
{
resources_container
.
nextSibling
.
innerHTML
=
""
;
resources_container
.
nextSibling
.
setAttribute
(
"
style
"
,
"
display:none
"
);
}
else
{
resources_container
.
nextSibling
.
setAttribute
(
"
style
"
,
"
display:block
"
);
}
}
}
}
}
}
...
@@ -54,6 +58,8 @@ function selectHiddenManagement() {
...
@@ -54,6 +58,8 @@ function selectHiddenManagement() {
}
}
jQuery
(
document
).
ready
(
function
(
$
)
{
jQuery
(
document
).
ready
(
function
(
$
)
{
//Actualize pagination
actualizePagination
()
// Get the element with id="defaultOpen" and click on it
// Get the element with id="defaultOpen" and click on it
document
.
getElementById
(
"
defaultOpen
"
).
click
();
document
.
getElementById
(
"
defaultOpen
"
).
click
();
...
@@ -210,10 +216,6 @@ jQuery(document).ready(function($) {
...
@@ -210,10 +216,6 @@ jQuery(document).ready(function($) {
let
field_hidden_field
=
document
.
querySelectorAll
(
let
field_hidden_field
=
document
.
querySelectorAll
(
'
hidden-widget[name="more_criterias_hidden"] select[name="field"]
'
'
hidden-widget[name="more_criterias_hidden"] select[name="field"]
'
);
);
console
.
log
(
"
field_field_search
"
,
field_field_search
)
console
.
log
(
"
field_hidden_field
"
,
field_hidden_field
)
field_field_search
.
onchange
=
function
()
{
field_field_search
.
onchange
=
function
()
{
let
option_selected
=
field_field_search
.
querySelector
(
let
option_selected
=
field_field_search
.
querySelector
(
...
@@ -225,15 +227,15 @@ jQuery(document).ready(function($) {
...
@@ -225,15 +227,15 @@ jQuery(document).ready(function($) {
for
(
let
option_hidden
of
options_hidden
)
{
for
(
let
option_hidden
of
options_hidden
)
{
//Removing the selected attribute from previous selection
//Removing the selected attribute from previous selection
option_hidden
.
removeAttribute
(
"
selected
"
);
option_hidden
.
removeAttribute
(
"
selected
"
);
console
.
log
(
"
option_hidden.value
"
,
option_hidden
.
value
)
console
.
log
(
"
option_selected.value
"
,
option_selected
.
value
)
if
(
option_hidden
.
value
==
option_selected
.
value
)
{
if
(
option_hidden
.
value
==
option_selected
.
value
)
{
//Actually selecting the option if it is the good one
//Actually selecting the option if it is the good one
console
.
log
(
"
match
"
)
console
.
log
(
"
match
"
)
option_hidden
.
setAttribute
(
"
selected
"
,
"
selected
"
);
option_hidden
.
setAttribute
(
"
selected
"
,
"
selected
"
);
select_hidden
.
setAttribute
(
'
value
'
,
option_selected
.
value
)
select_hidden
.
setAttribute
(
'
value
'
,
option_selected
.
value
)
console
.
log
(
"
select_hidden
"
,
select_hidden
)
console
.
log
(
"
option_hidden.value
"
,
option_hidden
.
value
)
console
.
log
(
"
option_selected.value
"
,
option_selected
.
value
)
}
}
...
...
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