Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
cdf23275
Commit
cdf23275
authored
Oct 05, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add accessor for current val for convenience.
parent
80864a19
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
app/assets/javascripts/gl_field_errors.js.es6
app/assets/javascripts/gl_field_errors.js.es6
+9
-5
No files found.
app/assets/javascripts/gl_field_errors.js.es6
View file @
cdf23275
...
...
@@ -68,9 +68,13 @@
}
accessCurrentVal(newVal) {
return newVal ? this.inputElement.val(newVal) : this.inputElement.val();
}
handleInvalidInput(event) {
event.preventDefault();
const currentValue = this.
inputElement.v
al();
const currentValue = this.
accessCurrentV
al();
this.state.valid = false;
this.state.empty = currentValue === '';
...
...
@@ -87,7 +91,7 @@
}
updateValidityState() {
const inputVal = this.
inputElement.v
al();
const inputVal = this.
accessCurrentV
al();
this.state.empty = !inputVal.length;
this.state.valid = this.getInputValidity();
this.renderValidity();
...
...
@@ -108,10 +112,10 @@
}
setClearState() {
const inputVal = this.
inputElement.v
al();
const inputVal = this.
accessCurrentV
al();
if (!inputVal.split(' ').length) {
const trimmedInput =
this.inputElement.val()
.trim();
this.
inputElement.v
al(trimmedInput);
const trimmedInput =
inputVal
.trim();
this.
accessCurrentV
al(trimmedInput);
}
this.inputElement.removeClass(inputErrorClass);
this.scopedSiblings.hide();
...
...
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