summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2018-04-12 14:13:50 -0500
committerClement Ho <ClemMakesApps@gmail.com>2018-04-12 14:13:50 -0500
commit705d7f703b10f5e1a066d0623bf32d07868d6668 (patch)
treed8e836e57ce9d5b7a7254a378fa4fa78dcd6bce0
parentb8401cd0b201ab9caecb60dcc477637e70da4df9 (diff)
downloadgitlab-ce-705d7f703b10f5e1a066d0623bf32d07868d6668.tar.gz
[skip ci] Use toggleClass instead of toggle
-rw-r--r--app/assets/javascripts/behaviors/secret_values.js4
-rw-r--r--app/assets/javascripts/behaviors/toggler_behavior.js2
-rw-r--r--app/assets/javascripts/build_variables.js2
-rw-r--r--app/assets/javascripts/ci_variable_list/ajax_variable_list.js10
-rw-r--r--app/assets/javascripts/merge_request_tabs.js2
-rw-r--r--app/assets/javascripts/notes.js4
-rw-r--r--app/assets/javascripts/pages/admin/admin.js2
-rw-r--r--app/assets/javascripts/pages/explore/groups/index.js2
-rw-r--r--app/assets/javascripts/pages/users/user_tabs.js2
-rw-r--r--app/assets/javascripts/project_fork.js2
-rw-r--r--app/helpers/icons_helper.rb2
11 files changed, 17 insertions, 17 deletions
diff --git a/app/assets/javascripts/behaviors/secret_values.js b/app/assets/javascripts/behaviors/secret_values.js
index 0d6e0dbefcc..8a7babf6870 100644
--- a/app/assets/javascripts/behaviors/secret_values.js
+++ b/app/assets/javascripts/behaviors/secret_values.js
@@ -33,12 +33,12 @@ export default class SecretValues {
updateDom(isRevealed) {
const values = this.container.querySelectorAll(this.valueSelector);
values.forEach((value) => {
- value.classList.toggle('hide', !isRevealed);
+ value.classList.toggle('hidden', !isRevealed);
});
const placeholders = this.container.querySelectorAll(this.placeholderSelector);
placeholders.forEach((placeholder) => {
- placeholder.classList.toggle('hide', isRevealed);
+ placeholder.classList.toggle('hidden', isRevealed);
});
this.revealButton.textContent = isRevealed ? n__('Hide value', 'Hide values', values.length) : n__('Reveal value', 'Reveal values', values.length);
diff --git a/app/assets/javascripts/behaviors/toggler_behavior.js b/app/assets/javascripts/behaviors/toggler_behavior.js
index 4446be0e52f..af7dee59214 100644
--- a/app/assets/javascripts/behaviors/toggler_behavior.js
+++ b/app/assets/javascripts/behaviors/toggler_behavior.js
@@ -20,7 +20,7 @@ $(() => {
$container
.find('.js-toggle-content')
- .toggle(toggleState);
+ .toggleClass('hidden', toggleState);
}
$('body').on('click', '.js-toggle-button', function toggleButton(e) {
diff --git a/app/assets/javascripts/build_variables.js b/app/assets/javascripts/build_variables.js
index d398e4a4c83..165343dc6af 100644
--- a/app/assets/javascripts/build_variables.js
+++ b/app/assets/javascripts/build_variables.js
@@ -4,7 +4,7 @@ export default function handleRevealVariables() {
$('.js-reveal-variables')
.off('click')
.on('click', function click() {
- $('.js-build-variables').toggle();
+ $('.js-build-variables').toggleClass('hidden');
$(this).hide();
});
}
diff --git a/app/assets/javascripts/ci_variable_list/ajax_variable_list.js b/app/assets/javascripts/ci_variable_list/ajax_variable_list.js
index b33adff609f..44f9e02a3c6 100644
--- a/app/assets/javascripts/ci_variable_list/ajax_variable_list.js
+++ b/app/assets/javascripts/ci_variable_list/ajax_variable_list.js
@@ -52,8 +52,8 @@ export default class AjaxVariableList {
onSaveClicked() {
const loadingIcon = this.saveButton.querySelector('.js-secret-variables-save-loading-icon');
- loadingIcon.classList.toggle('hide', false);
- this.errorBox.classList.toggle('hide', true);
+ loadingIcon.classList.toggle('hidden', false);
+ this.errorBox.classList.toggle('hidden', true);
// We use this to prevent a user from changing a key before we have a chance
// to match it up in `updateRowsWithPersistedVariables`
this.variableList.toggleEnableRow(false);
@@ -70,7 +70,7 @@ export default class AjaxVariableList {
status === statusCodes.BAD_REQUEST,
})
.then((res) => {
- loadingIcon.classList.toggle('hide', true);
+ loadingIcon.classList.toggle('hidden', true);
this.variableList.toggleEnableRow(true);
if (res.status === statusCodes.OK && res.data) {
@@ -79,11 +79,11 @@ export default class AjaxVariableList {
} else if (res.status === statusCodes.BAD_REQUEST) {
// Validation failed
this.errorBox.innerHTML = generateErrorBoxContent(res.data);
- this.errorBox.classList.toggle('hide', false);
+ this.errorBox.classList.toggle('hidden', false);
}
})
.catch(() => {
- loadingIcon.classList.toggle('hide', true);
+ loadingIcon.classList.toggle('hidden', true);
this.variableList.toggleEnableRow(true);
Flash(s__('CiVariable|Error occured while saving variables'));
});
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js
index e77318fef46..00a212f3d5f 100644
--- a/app/assets/javascripts/merge_request_tabs.js
+++ b/app/assets/javascripts/merge_request_tabs.js
@@ -367,7 +367,7 @@ export default class MergeRequestTabs {
//
// status - Boolean, true to show, false to hide
toggleLoading(status) {
- $('.mr-loading-status .loading').toggle(status);
+ $('.mr-loading-status .loading').toggleClass('hidden', status);
}
diffViewType() {
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js
index b4daeb7067b..b0459cbf696 100644
--- a/app/assets/javascripts/notes.js
+++ b/app/assets/javascripts/notes.js
@@ -1229,8 +1229,8 @@ export default class Notes {
const isForced = forceShow === true || forceShow === false;
const showNow = forceShow === true || (!isCurrentlyShown && !isForced);
- targetRow.toggle(showNow);
- notesContent.toggle(showNow);
+ targetRow.toggleClass('hidden', showNow);
+ notesContent.toggleClass('hidden', showNow);
}
if (addForm) {
diff --git a/app/assets/javascripts/pages/admin/admin.js b/app/assets/javascripts/pages/admin/admin.js
index 91f154b7ecd..ab4a02c82de 100644
--- a/app/assets/javascripts/pages/admin/admin.js
+++ b/app/assets/javascripts/pages/admin/admin.js
@@ -25,7 +25,7 @@ export default function adminInit() {
$('body').on('click', '.js-toggle-colors-link', (e) => {
e.preventDefault();
- $('.js-toggle-colors-container').toggle();
+ $('.js-toggle-colors-container').toggleClass('hidden');
});
$('.log-tabs a').on('click', function logTabsClick(e) {
diff --git a/app/assets/javascripts/pages/explore/groups/index.js b/app/assets/javascripts/pages/explore/groups/index.js
index 3c7edbdd7c7..2b5d2ba4840 100644
--- a/app/assets/javascripts/pages/explore/groups/index.js
+++ b/app/assets/javascripts/pages/explore/groups/index.js
@@ -12,5 +12,5 @@ document.addEventListener('DOMContentLoaded', () => {
landingElement.querySelector('.dismiss-button'),
'explore_groups_landing_dismissed',
);
- exploreGroupsLanding.toggle();
+ exploreGroupsLanding.toggleClass('hidden');
});
diff --git a/app/assets/javascripts/pages/users/user_tabs.js b/app/assets/javascripts/pages/users/user_tabs.js
index 124bc2ba710..f7d684bc414 100644
--- a/app/assets/javascripts/pages/users/user_tabs.js
+++ b/app/assets/javascripts/pages/users/user_tabs.js
@@ -181,7 +181,7 @@ export default class UserTabs {
toggleLoading(status) {
return this.$parentEl.find('.loading-status .loading')
- .toggle(status);
+ .toggleClass('hidden', status);
}
setCurrentAction(source) {
diff --git a/app/assets/javascripts/project_fork.js b/app/assets/javascripts/project_fork.js
index 6fedd94a6a9..f5cd1c3cc3e 100644
--- a/app/assets/javascripts/project_fork.js
+++ b/app/assets/javascripts/project_fork.js
@@ -4,6 +4,6 @@ export default () => {
$('.js-fork-thumbnail').on('click', function forkThumbnailClicked() {
if ($(this).hasClass('disabled')) return false;
- return $('.js-fork-content').toggle();
+ return $('.js-fork-content').toggleClass('hidden');
});
};
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index c5522ff7a69..08b7168b117 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -56,7 +56,7 @@ module IconsHelper
def spinner(text = nil, visible = false)
css_class = 'loading'
- css_class << ' hide' unless visible
+ css_class << ' hidden' unless visible
content_tag :div, class: css_class do
icon('spinner spin') + text