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
Commits
af9ef0de
Commit
af9ef0de
authored
1 year ago
by
L N
Committed by
Yas Naoi
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3402301
by nakamurarts, yas: Refactor to native JavaScript from jQuery...
Issue
#3402301
by nakamurarts, yas: Refactor to native JavaScript from jQuery (k8s_all_resources.js)
parent
c6e4f7c4
No related branches found
No related tags found
1 merge request
!2123
Issue #3386224 by asai.noriaki, yas: Fix an issue where clicking an OpenStack...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/cloud_service_providers/k8s/js/k8s_all_resources.js
+17
-16
17 additions, 16 deletions
modules/cloud_service_providers/k8s/js/k8s_all_resources.js
with
17 additions
and
16 deletions
modules/cloud_service_providers/k8s/js/k8s_all_resources.js
+
17
−
16
View file @
af9ef0de
(
function
(
$
)
{
(
function
()
{
'
use strict
'
;
let
cloud_context_namespaces
=
drupalSettings
.
k8s
.
cloud_context_namespaces
;
let
updateNamespaceOptions
=
function
(
cloud_context
)
{
$
(
'
#edit-namespace option
'
).
each
(
function
()
{
let
namespace
=
$
(
this
).
val
();
const
cloud_context_namespaces
=
drupalSettings
.
k8s
.
cloud_context_namespaces
;
const
updateNamespaceOptions
=
function
(
cloud_context
)
{
const
namespaceOptions
=
document
.
querySelectorAll
(
'
#edit-namespace option
'
);
namespaceOptions
.
forEach
(
function
(
option
)
{
const
namespace
=
option
.
value
;
// If the cloud context is any.
if
(
!
cloud_context
)
{
$
(
this
).
show
()
;
option
.
style
.
display
=
''
;
return
;
}
// If the namespace is any.
if
(
!
namespace
)
{
$
(
this
).
show
()
;
option
.
style
.
display
=
''
;
return
;
}
...
...
@@ -23,18 +25,17 @@
if
(
!
cloud_context_namespaces
[
cloud_context
]
||
!
cloud_context_namespaces
[
cloud_context
][
namespace
])
{
$
(
this
).
hide
();
if
(
$
(
this
).
prop
(
'
selected
'
))
{
$
(
this
).
prop
(
'
selected
'
,
''
);
}
option
.
style
.
display
=
'
none
'
;
option
.
selected
=
false
;
}
else
{
$
(
this
).
show
()
;
option
.
style
.
display
=
''
;
}
});
};
updateNamespaceOptions
(
$
(
'
#edit-cloud-context
'
).
val
());
$
(
'
#edit-cloud-context
'
).
change
(
function
()
{
updateNamespaceOptions
(
$
(
this
).
val
());
const
cloud_context_element
=
document
.
querySelector
(
'
#edit-cloud-context
'
);
updateNamespaceOptions
(
cloud_context_element
.
value
);
cloud_context_element
.
addEventListener
(
'
change
'
,
function
()
{
updateNamespaceOptions
(
this
.
value
);
});
})(
jQuery
);
})();
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