Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud
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
cloud
Merge requests
!2112
Issue
#3404519
: Refactor to native JavaScript from jQuery (k8s_cost_block.js)
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3404519
: Refactor to native JavaScript from jQuery (k8s_cost_block.js)
issue/cloud-3404519:3404519-refactor-to-native
into
6.x
Overview
0
Commits
2
Pipelines
4
Changes
2
Merged
L N
requested to merge
issue/cloud-3404519:3404519-refactor-to-native
into
6.x
1 year ago
Overview
0
Commits
2
Pipelines
4
Changes
2
Expand
Closes
#3404519
0
0
Merge request reports
Compare
6.x
version 2
37488790
1 year ago
version 1
9fd70ab8
1 year ago
6.x (base)
and
latest version
latest version
2cda6c8a
2 commits,
1 year ago
version 2
37488790
2 commits,
1 year ago
version 1
9fd70ab8
1 commit,
1 year ago
2 files
+
14
−
26
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
modules/cloud_service_providers/k8s/js/k8s_cost_block.js
+
14
−
22
Options
(
function
(
$
)
{
(
function
()
{
'
use strict
'
;
$
(
'
button[name=apply]
'
).
click
(
function
()
{
let
$parent
=
$
(
this
).
parent
(
'
.form-inline
'
);
if
(
$parent
.
length
===
0
||
$parent
.
parents
(
'
.panel
'
).
length
===
0
)
{
return
;
for
(
const
apply_button
of
document
.
querySelectorAll
(
'
.simple-datatable .form-inline .button[name="apply"]
'
))
{
const
form_inline
=
apply_button
.
closest
(
'
.form-inline
'
);
const
block_id
=
form_inline
.
closest
(
'
.simple-datatable
'
).
id
;
if
(
!
block_id
)
{
continue
;
}
let
block_id
=
$parent
.
parents
(
'
.panel
'
).
attr
(
'
id
'
);
let
params
=
(
new
URL
(
location
)).
searchParams
;
let
param_arr
=
[];
$parent
.
find
(
'
select
'
).
each
(
function
()
{
let
name
=
$
(
this
).
attr
(
'
name
'
);
params
.
set
(
block_id
+
'
[
'
+
name
+
'
]
'
,
$
(
this
).
val
());
apply_button
.
addEventListener
(
'
click
'
,
function
()
{
const
url
=
new
URL
(
location
.
href
);
form_inline
.
querySelectorAll
(
'
select
'
).
forEach
(
function
(
select
)
{
url
.
searchParams
.
set
(
block_id
+
'
[
'
+
select
.
name
+
'
]
'
,
select
.
value
);
});
location
.
href
=
url
.
href
;
});
if
(
Array
.
from
(
params
).
length
===
0
)
{
return
;
}
let
url
=
location
.
href
;
if
(
url
.
indexOf
(
'
?
'
)
!==
-
1
)
{
url
=
url
.
substr
(
0
,
url
.
indexOf
(
'
?
'
));
}
location
=
url
+
'
?
'
+
params
.
toString
();
});
})(
jQuery
);
}
})();
Loading