Fix show page toggle

This commit is contained in:
Filipa Lacerda 2017-11-29 16:21:26 +00:00
parent 50d9cc6d1d
commit 80d21e647b
No known key found for this signature in database
GPG key ID: 9CA3FDE4D1E2F1C8
3 changed files with 4 additions and 4 deletions

View file

@ -145,8 +145,8 @@ export default class Clusters {
}
toggle() {
this.toggleButton.classList.toggle('checked');
this.toggleInput.setAttribute('value', this.toggleButton.classList.contains('checked').toString());
this.toggleButton.classList.toggle('is-checked');
this.toggleInput.setAttribute('value', this.toggleButton.classList.contains('is-checked').toString());
}
hideAll() {

View file

@ -48,7 +48,7 @@
= field.hidden_field :enabled, { class: 'js-toggle-input'}
%button{ type: 'button',
class: "js-toggle-cluster project-feature-toggle #{'checked' unless !@cluster.enabled?} #{'disabled' unless can?(current_user, :update_cluster, @cluster)}",
class: "js-toggle-cluster project-feature-toggle #{'is-checked' unless !@cluster.enabled?} #{'is-disabled' unless can?(current_user, :update_cluster, @cluster)}",
'aria-label': s_('ClusterIntegration|Toggle Cluster'),
disabled: !can?(current_user, :update_cluster, @cluster),
data: { 'enabled-text': 'Enabled', 'disabled-text': 'Disabled' } }

View file

@ -28,7 +28,7 @@ describe('Clusters', () => {
expect(
cluster.toggleButton.classList,
).not.toContain('checked');
).not.toContain('is-checked');
expect(
cluster.toggleInput.getAttribute('value'),