/*! * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 * @version 1.3.0 * * Client validation extension for the yii2-field-range extension * * Author: Kartik Visweswaran * Copyright: 2014, Kartik Visweswaran, Krajee.com * For more JQuery plugins visit http://plugins.krajee.com * For more Yii related demos visit http://demos.krajee.com */!function(r){var t=function(r){return"[object Array]"===Object.prototype.toString.call(r)||"[object Object]"===Object.prototype.toString.call(r)},e=function(t,e){this.$attrTo=r(t),this.$attrFrom=r("#"+e.attrFrom),this.$mainContainer=r("#"+e.container),this.$errorContainer=r("#"+e.errorContainer),this.$errorBlockFrom=this.$attrFrom.closest(".kv-container-from").find(".help-block"),this.$errorBlockTo=this.$attrTo.closest(".kv-container-to").find(".help-block"),this.$errorBlock=this.$errorContainer.find(".help-block"),this.$form=this.$attrFrom.closest("form"),this.errorToMsg="",this.init()};e.prototype={constructor:e,init:function(){var r=this;r.$errorBlockFrom.hide(),r.$errorBlockTo.hide(),r.$form.on("reset.yiiActiveForm",function(){setTimeout(function(){r.reset()},100)}),r.$form.on("afterValidate",function(t,e){var s=r.$attrFrom.attr("id"),o=r.$attrTo.attr("id");s in e&&r.validateAttribute(e[s],s,o),o in e&&r.validateAttribute(e[o],s,o)}),r.$form.on("afterValidateAttribute",function(t,e,s){var o=r.$attrFrom.attr("id"),a=r.$attrTo.attr("id");r.$errorBlock.html(""),r.$errorContainer.removeClass("has-success has-error"),(e.id==o||e.id==a)&&r.validateAttribute(s,o,a)})},validateAttribute:function(e,s,o){var a=this,i=e.length,n="";t(e)&&i?n=1==i?e[0]:e.join("