BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
59fa98dd
Commit
59fa98dd
authored
Nov 29, 2016
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable ESLint and fix minor code style stuff in project_variables.js.es6.
parent
1fa55069
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
21 deletions
+20
-21
project_variables.js.es6
app/assets/javascripts/project_variables.js.es6
+20
-21
No files found.
app/assets/javascripts/project_variables.js.es6
View file @
59fa98dd
/* eslint-disable */
((global) => {
(() => {
const HIDDEN_VALUE_TEXT = '******';
class ProjectVariables {
constructor() {
this.$reveal = $('.js-btn-toggle-reveal-values');
this.$reveal.on('click', this.toggleRevealState.bind(this));
this.$revealBtn = $('.js-btn-toggle-reveal-values');
this.$revealBtn.on('click', this.toggleRevealState.bind(this));
}
toggleRevealState(e
vent
) {
e
vent
.preventDefault();
toggleRevealState(e) {
e.preventDefault();
const $btn = $(event.currentTarget);
const oldStatus = $btn.attr('data-status');
const oldStatus = this.$revealBtn.attr('data-status');
let newStatus = 'hidden';
let newAction = 'Reveal Values';
if (oldStatus == 'hidden') {
[newStatus, newAction] = ['revealed', 'Hide Values'];
} else {
[newStatus, newAction] = ['hidden', 'Reveal Values'];
if (oldStatus === 'hidden') {
newStatus = 'revealed';
newAction = 'Hide Values';
}
$b
tn.attr('data-status', newStatus);
this.$revealB
tn.attr('data-status', newStatus);
le
t $variables = $('.variable-value');
cons
t $variables = $('.variable-value');
$variables.each(
function (_, variable)
{
le
t $variable = $(variable);
$variables.each(
(_, variable) =>
{
cons
t $variable = $(variable);
let newText = HIDDEN_VALUE_TEXT;
if (newStatus == 'revealed') {
if (newStatus ==
=
'revealed') {
newText = $variable.attr('data-value');
}
$variable.text(newText);
});
$b
tn.text(newAction);
this.$revealB
tn.text(newAction);
}
}
global.ProjectVariables = ProjectVariables;
})(window.gl || (window.gl = {}));
window.gl = window.gl || {};
window.gl.ProjectVariables = ProjectVariables;
})();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment