Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
knowledgebase-front
Manage
Activity
Members
Labels
Plan
Issues
19
Issue boards
Milestones
Wiki
Code
Merge requests
3
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
5d64b1b4
Commit
5d64b1b4
authored
4 years ago
by
Benoit Alessandroni
Browse files
Options
Downloads
Patches
Plain Diff
Fixing useless calls to refresh pagination
parent
1ec9e96a
No related branches found
Branches containing commit
No related tags found
1 merge request
!158
Fixing useless calls to refresh pagination
Pipeline
#5765
failed with stage
in 1 hour
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scripts/coopstarter.js
+22
-28
22 additions, 28 deletions
src/scripts/coopstarter.js
with
22 additions
and
28 deletions
src/scripts/coopstarter.js
+
22
−
28
View file @
5d64b1b4
...
...
@@ -246,34 +246,28 @@ function InitManagementForType() {
var
forms
=
document
.
querySelectorAll
(
"
.resource_by_step
"
);
forms
.
forEach
(
form
=>
{
form
.
addEventListener
(
"
populate
"
,
e
=>
{
window
.
setTimeout
(()
=>
{
let
type_hidden_field
=
form
.
querySelectorAll
(
'
select[name="type"]
'
);
type_hidden_field
.
forEach
(
function
(
select_hidden
)
{
options_hidden
=
select_hidden
.
getElementsByTagName
(
"
option
"
);
for
(
let
option_hidden
of
options_hidden
)
{
option_hidden
.
removeAttribute
(
"
selected
"
);
str
=
option_hidden
.
value
if
(
str
.
substr
(
str
.
length
-
10
)
==
'
types/1/"}
'
)
{
//Actually selecting the option if it is the good one
option_hidden
.
setAttribute
(
"
selected
"
,
"
selected
"
);
select_hidden
.
setAttribute
(
"
value
"
,
option_hidden
.
value
);
}
}
//Trigerring a reload of the associated form
let
parent_form
=
select_hidden
.
closest
(
"
sib-form
"
);
parent_form
.
component
.
inputChange
();
parent_form
.
dispatchEvent
(
new
CustomEvent
(
'
formChange
'
));
refreshPagination
();
});
});
},
3000
);
form
.
addEventListener
(
"
populate
"
,
e
=>
{
let
type_hidden_field
=
form
.
querySelectorAll
(
'
select[name="type"]
'
);
type_hidden_field
.
forEach
(
function
(
select_hidden
)
{
options_hidden
=
select_hidden
.
getElementsByTagName
(
"
option
"
);
for
(
let
option_hidden
of
options_hidden
)
{
option_hidden
.
removeAttribute
(
"
selected
"
);
str
=
option_hidden
.
value
if
(
str
.
substr
(
str
.
length
-
10
)
==
'
types/1/"}
'
)
{
//Actually selecting the option if it is the good one
option_hidden
.
setAttribute
(
"
selected
"
,
"
selected
"
);
select_hidden
.
setAttribute
(
"
value
"
,
option_hidden
.
value
);
}
}
//Trigerring a reload of the associated form
let
parent_form
=
select_hidden
.
closest
(
"
sib-form
"
);
parent_form
.
component
.
inputChange
();
parent_form
.
dispatchEvent
(
new
CustomEvent
(
'
formChange
'
));
refreshPagination
();
});
});
});
}
...
...
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