summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/project_variables.js
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-11-17 14:43:10 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-11-17 14:43:10 +0000
commitaf2981dd3d058f3ad38de7f2e885c4be5e8c2590 (patch)
tree6cf905c3f46dffbdfc031239eb64cb39aa8951ee /app/assets/javascripts/project_variables.js
parent31cb9befe8549ae9f82ed9267712351ed279cd2c (diff)
parente68ee8af4d981cb7b83fae76c0a94059add495fb (diff)
downloadgitlab-ce-40016-log-header.tar.gz
Merge branch 'master' into 40016-log-header40016-log-header
* master: (21 commits) Changing OAuth lookup to be case insensitive Delete orphaned fork networks in a migration Delete the fork network when removing the last membership Resolve "Performance issues when loading large number of wiki pages" Exports a couple of project related code as es6 modules Fix go-import meta data when enabled_git_access_protocol is a blank string Add dropdowns documentation Convert migration to populate latest merge request ID into a background migration Set 0.69.0 instead of latest for codeclimate image Fix hashed storage with project transfers to another namespace De-duplicate background migration matchers defined in spec/support/migrations_helpers.rb Update database_debugging.md Update database_debugging.md Move installation of apps higher Change to Google Kubernetes Cluster and add internal links Add Ingress description from official docs Add info on creating your own k8s cluster from the cluster page Add info about the installed apps in the Cluster docs Update HA README.md to clarify GitLab support does not troubleshoot DRBD. Optimise getting the pipeline status of commits ...
Diffstat (limited to 'app/assets/javascripts/project_variables.js')
-rw-r--r--app/assets/javascripts/project_variables.js60
1 files changed, 28 insertions, 32 deletions
diff --git a/app/assets/javascripts/project_variables.js b/app/assets/javascripts/project_variables.js
index 4ee2e49306d..567c311f119 100644
--- a/app/assets/javascripts/project_variables.js
+++ b/app/assets/javascripts/project_variables.js
@@ -1,43 +1,39 @@
-(() => {
- const HIDDEN_VALUE_TEXT = '******';
- class ProjectVariables {
- constructor() {
- this.$revealBtn = $('.js-btn-toggle-reveal-values');
- this.$revealBtn.on('click', this.toggleRevealState.bind(this));
- }
+const HIDDEN_VALUE_TEXT = '******';
+
+export default class ProjectVariables {
+ constructor() {
+ this.$revealBtn = $('.js-btn-toggle-reveal-values');
+ this.$revealBtn.on('click', this.toggleRevealState.bind(this));
+ }
- toggleRevealState(e) {
- e.preventDefault();
+ toggleRevealState(e) {
+ e.preventDefault();
- const oldStatus = this.$revealBtn.attr('data-status');
- let newStatus = 'hidden';
- let newAction = 'Reveal Values';
+ const oldStatus = this.$revealBtn.attr('data-status');
+ let newStatus = 'hidden';
+ let newAction = 'Reveal Values';
- if (oldStatus === 'hidden') {
- newStatus = 'revealed';
- newAction = 'Hide Values';
- }
+ if (oldStatus === 'hidden') {
+ newStatus = 'revealed';
+ newAction = 'Hide Values';
+ }
- this.$revealBtn.attr('data-status', newStatus);
+ this.$revealBtn.attr('data-status', newStatus);
- const $variables = $('.variable-value');
+ const $variables = $('.variable-value');
- $variables.each((_, variable) => {
- const $variable = $(variable);
- let newText = HIDDEN_VALUE_TEXT;
+ $variables.each((_, variable) => {
+ const $variable = $(variable);
+ let newText = HIDDEN_VALUE_TEXT;
- if (newStatus === 'revealed') {
- newText = $variable.attr('data-value');
- }
+ if (newStatus === 'revealed') {
+ newText = $variable.attr('data-value');
+ }
- $variable.text(newText);
- });
+ $variable.text(newText);
+ });
- this.$revealBtn.text(newAction);
- }
+ this.$revealBtn.text(newAction);
}
-
- window.gl = window.gl || {};
- window.gl.ProjectVariables = ProjectVariables;
-})();
+}