From bfff8f950118996630f3fe02a781349f3cdc7f67 Mon Sep 17 00:00:00 2001 From: iae SAUDI Date: Fri, 2 Oct 2015 23:44:55 +0300 Subject: [PATCH] Reformatted the implementation Reformatted the RTL implementation in better way, Thanks to @posabsolute --- js/jquery.validationEngine.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/jquery.validationEngine.js b/js/jquery.validationEngine.js index da410b1..aed43b8 100644 --- a/js/jquery.validationEngine.js +++ b/js/jquery.validationEngine.js @@ -1690,15 +1690,17 @@ } var pos = methods._calculatePosition(field, prompt, options); + // Support RTL layouts by @yasser_lotfy ( Yasser Lotfy ) + var isRTL = $('body').hasClass('rtl'); prompt.css({ 'position': positionType === 'inline' ? 'relative' : 'absolute', "top": pos.callerTopPosition, - "left": pos.callerleftPosition, + "left": isRTL ? "initial" : pos.callerleftPosition, + "right": isRTL ? pos.callerleftPosition : "initial", "marginTop": pos.marginTopSize, "opacity": 0 }).data("callerField", field); - if (options.autoHidePrompt) { setTimeout(function(){ prompt.animate({ @@ -1742,8 +1744,11 @@ prompt.find(".formErrorContent").html(promptText); var pos = methods._calculatePosition(field, prompt, options); + // Support RTL layouts by @yasser_lotfy ( Yasser Lotfy ) + var isRTL = $('body').hasClass('rtl'); var css = {"top": pos.callerTopPosition, - "left": pos.callerleftPosition, + "left": isRTL ? "initial" : pos.callerleftPosition, + "right": isRTL ? pos.callerleftPosition : "initial", "marginTop": pos.marginTopSize, "opacity": 0.87};