Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-12-01 14:56:31 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2017-12-04 00:03:43 +0300
commitbea4303840308e10e073134cab294181c744c770 (patch)
tree4e6cd0e208c9ed202ced31cbc0e7d51d484a6d78 /app/assets/javascripts/clusters
parent363c57468dc6f656c6c345f0b9eda32029571201 (diff)
Fix clusters active/inactive toggling
Diffstat (limited to 'app/assets/javascripts/clusters')
-rw-r--r--app/assets/javascripts/clusters/clusters_index.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/clusters/clusters_index.js b/app/assets/javascripts/clusters/clusters_index.js
index 3fd188a8770..82ac8d93035 100644
--- a/app/assets/javascripts/clusters/clusters_index.js
+++ b/app/assets/javascripts/clusters/clusters_index.js
@@ -28,7 +28,7 @@ const toggleValue = (button) => {
*
* When the user clicks the toggle button for each cluster, it:
* - toggles the button
- * - shows a loding and disabled state
+ * - shows a loading and disabled state
* - Makes a put request to the given endpoint
* Once we receive the response, either:
* 1) Show updated status in case of successfull response
@@ -38,12 +38,13 @@ export default function setClusterTableToggles() {
document.querySelectorAll('.js-toggle-cluster-list')
.forEach(button => button.addEventListener('click', (e) => {
const toggleButton = e.currentTarget;
- const value = toggleButton.classList.contains('checked').toString();
const endpoint = toggleButton.getAttribute('data-endpoint');
toggleValue(toggleButton);
toggleLoadingButton(toggleButton);
+ const value = toggleButton.classList.contains('is-checked');
+
ClustersService.updateCluster(endpoint, { cluster: { enabled: value } })
.then(() => {
toggleLoadingButton(toggleButton);