Skip to content

Commit 6595916

Browse files
author
Tom Hanoldt
committed
formatting
1 parent 9181000 commit 6595916

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/input.validator.coffee

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,17 @@ class @InputValidator
131131

132132
$elements = @elements(context)
133133
if @config.validateOnFocusOut
134-
$elements.focusout (e) =>
135-
@validateElement(e.target)
134+
$elements.focusout (e) => @validateElement(e.target)
136135

137136
if @config.removeHintOnFocus
138-
$elements.focus (e) =>
139-
@resetElement(e.target)
137+
$elements.focus (e) => @resetElement(e.target)
140138

141139
if @config.validateOnKeyUp
142140
$elements.keyup (e) =>
143141
@validateElement(e.target) if $(e.target).data('invalid')
144142

145143
if @config.validateOnClick
146-
$elements.click (e) =>
147-
errors = @validateElement(e.target)
148-
144+
$elements.click (e) => @validateElement(e.target)
149145

150146
validate: (context = null) =>
151147
errors = []
@@ -163,7 +159,7 @@ class @InputValidator
163159
for name, rule of @config.rules
164160
unless rule(@, $element, value)
165161
errors.push {
166-
message: $element.data("msg-#{name}") || @getMessage(name)
162+
message: $element.data("msg-#{name}") || @messageFor(name)
167163
element: $element
168164
rule: name
169165
value: value
@@ -191,6 +187,6 @@ class @InputValidator
191187
$(@config.selectors.elements, context)
192188
.not(@config.selectors.ignore)
193189

194-
getMessage: (name) =>
190+
messageFor: (name) =>
195191
return @config.messages.generic unless @config.messages?[name]
196192
@config.messages[name]

0 commit comments

Comments
 (0)