Skip to content

Commit 0939a76

Browse files
committed
Merge pull request posabsolute#714 from roverdotcom/fix_positioning_and_allow_radio_arrow
Add the `showArrowOnRadioAndCheckbox` option, and change the positioning calculus a bit
2 parents b59f243 + 7a59520 commit 0939a76

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
@@ -725,7 +725,7 @@
725725
} else {
726726
field = $(form.find("input[name='" + fieldName + "'][type!=hidden]:first"));
727727
}
728-
options.showArrow = false;
728+
options.showArrow = options.showArrowOnRadioAndCheckbox;
729729
}
730730

731731
if(field.is(":hidden") && options.prettySelect) {
@@ -1833,7 +1833,7 @@
18331833
switch (positionType) {
18341834
default:
18351835
case "topRight":
1836-
promptleftPosition += fieldLeft + fieldWidth - 30;
1836+
promptleftPosition += fieldLeft + fieldWidth - 27;
18371837
promptTopPosition += fieldTop;
18381838
break;
18391839

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

0 commit comments

Comments
 (0)