Component-Builder-fork/admin/custom/form-password.min.js

3 lines
932 B
JavaScript
Raw Normal View History

/*! UIkit 2.0.0 | https://www.getuikit.com | (c) 2013 YOOtheme | MIT License */
(function(t,e){var n=function(e,i){var s=this,o=t(e);o.data("formPassword")||(this.options=t.extend({},n.defaults,i),this.element=o.on("click",function(t){if(t.preventDefault(),s.input.length){var e=s.input.attr("type");s.input.attr("type","text"==e?"password":"text"),s.element.text(s.options["text"==e?"lblShow":"lblHide"])}}),s.input=this.element.next("input").length?this.element.next("input"):this.element.prev("input"),s.element.text(this.options[s.input.is("[type='password']")?"lblShow":"lblHide"]),this.element.data("formPassword",this))};n.defaults={lblShow:"Show",lblHide:"Hide"},e.formPassword=n,t(document).on("click.formpassword.uikit","[data-uk-form-password]",function(i){var s=t(this);s.data("formPassword")||(i.preventDefault(),new n(s,e.Utils.options(s.attr("data-uk-form-password"))),s.trigger("click"))})})(jQuery,jQuery.UIkit);