Skip to content

Commit 7a59520

Browse files
author
Chris Roby
committed
Add the showArrowOnRadioAndCheckbox option, and change the positioning to
use 27 instead of 30 for the offset to better center the arrow on the elt
1 parent 95f7204 commit 7a59520

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ Determines if the prompt should hide itself automatically after a set period. De
415415
### autoHideDelay
416416
Sets the number of ms that the prompt should appear for if autoHidePrompt is set to *true*. Defaults to *10000*.
417417

418+
### showArrow
419+
Show the arrow in the validation popup. Defaults to *true*
420+
421+
### showArrowOnRadioAndCheckbox
422+
Show the arrow in the validation popup when validating checkboxes and radio buttons. Defaults to *false*
423+
418424
Validators
419425
---
420426

js/jquery.validationEngine.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@
724724
} else {
725725
field = $(form.find("input[name='" + fieldName + "'][type!=hidden]:first"));
726726
}
727-
options.showArrow = false;
727+
options.showArrow = options.showArrowOnRadioAndCheckbox;
728728
}
729729

730730
if(field.is(":hidden") && options.prettySelect) {
@@ -1832,7 +1832,7 @@
18321832
switch (positionType) {
18331833
default:
18341834
case "topRight":
1835-
promptleftPosition += fieldLeft + fieldWidth - 30;
1835+
promptleftPosition += fieldLeft + fieldWidth - 27;
18361836
promptTopPosition += fieldTop;
18371837
break;
18381838

@@ -1859,7 +1859,7 @@
18591859
promptleftPosition = fieldLeft;
18601860
break;
18611861
case "bottomRight":
1862-
promptleftPosition = fieldLeft + fieldWidth - 30;
1862+
promptleftPosition = fieldLeft + fieldWidth - 27;
18631863
promptTopPosition = fieldTop + field.height() + 5;
18641864
marginTopSize = 0;
18651865
break;
@@ -2034,6 +2034,9 @@
20342034
binded: true,
20352035
// set to true, when the prompt arrow needs to be displayed
20362036
showArrow: true,
2037+
// set to false, determines if the prompt arrow should be displayed when validating
2038+
// checkboxes and radio buttons
2039+
showArrowOnRadioAndCheckbox: false,
20372040
// did one of the validation fail ? kept global to stop further ajax validations
20382041
isError: false,
20392042
// Limit how many displayed errors a field can have

0 commit comments

Comments
 (0)