Skip to content

Commit b42da32

Browse files
committed
Fixing issue 257. Allow hide prompts without fade
1 parent 83df7d0 commit b42da32

8 files changed

+30
-15
lines changed

js/jquery.validationEngine.js

+30-15
Original file line numberDiff line numberDiff line change
@@ -180,38 +180,53 @@
180180
/**
181181
* Closes all error prompts on the page
182182
*/
183-
hidePrompt: function() {
183+
hidePrompt: function(fade) {
184184
var promptClass = "."+ methods._getClassName($(this).attr("id")) + "formError";
185-
$(promptClass).fadeTo("fast", 0.3, function() {
186-
$(this).parent('.formErrorOuter').remove();
187-
$(this).remove();
188-
});
185+
if(fade) {
186+
$(promptClass).fadeTo("fast", 0.3, function() {
187+
$(this).parent('.formErrorOuter').remove();
188+
$(this).remove();
189+
});
190+
} else {
191+
$(promptClass).parent('.formErrorOuter').remove();
192+
$(promptClass).remove();
193+
}
189194
return this;
190195
},
191196
/**
192197
* Closes form error prompts, CAN be invidual
193198
*/
194-
hide: function() {
199+
hide: function(fade) {
195200
var closingtag;
196201
if($(this).is("form")){
197202
closingtag = "parentForm"+methods._getClassName($(this).attr("id"));
198203
}else{
199204
closingtag = methods._getClassName($(this).attr("id")) +"formError";
200205
}
201-
$('.'+closingtag).fadeTo("fast", 0.3, function() {
202-
$(this).parent('.formErrorOuter').remove();
203-
$(this).remove();
204-
});
206+
if(fade) {
207+
$('.'+closingtag).fadeTo("fast", 0.3, function() {
208+
$(this).parent('.formErrorOuter').remove();
209+
$(this).remove();
210+
});
211+
} else {
212+
$('.'+closingtag).parent('.formErrorOuter').remove();
213+
$('.'+closingtag).remove();
214+
}
205215
return this;
206216
},
207217
/**
208218
* Closes all error prompts on the page
209219
*/
210-
hideAll: function() {
211-
$('.formError').fadeTo("fast", 0.3, function() {
212-
$(this).parent('.formErrorOuter').remove();
213-
$(this).remove();
214-
});
220+
hideAll: function(fade) {
221+
if(fade) {
222+
$('.formError').fadeTo("fast", 0.3, function() {
223+
$(this).parent('.formErrorOuter').remove();
224+
$(this).remove();
225+
});
226+
} else {
227+
$('.formError').parent('.formErrorOuter').remove();
228+
$('.formError').remove();
229+
}
215230
return this;
216231
},
217232
/**
Binary file not shown.
Binary file not shown.

test/AjaxTestServer.class

-3.22 KB
Binary file not shown.

test/NanoHTTPD$1.class

817 Bytes
Binary file not shown.

test/NanoHTTPD$HTTPSession.class

1.25 KB
Binary file not shown.

test/NanoHTTPD$Response.class

-3.77 KB
Binary file not shown.

test/NanoHTTPD.class

5.97 KB
Binary file not shown.

0 commit comments

Comments
 (0)