-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.autohideinput.min.js
16 lines (16 loc) · 1.12 KB
/
jquery.autohideinput.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
* If you create a derivative, please leave this text intact:
*
* jquery.autohideinput.js
*
* Copyright (c) 2013, Vitalii Tereshchuk http://dotoca.net/
*
* @modified 2013/01/15
* @requires jQuery 1.7.x or later
* @version 2.0.2
* @author Vitalii Tereshchuk
* @link http://dotoca.net/jquery-autohideinput/
* @license
*
* Thanks to Vitalii Tereshchuk (http://dotoca.net/)
*/(function(e){var t="text";autoHideInput=function(t){var n=e(this);n.on("blur",function(){n.attr("type","password")}),n.on("focusin",function(){n.attr("type","text")})};var n={init:function(e){return this.each(autoHideInput)},hide:function(t){var n=e(this);n.data("hide",t),t?(n.attr("type","password"),n.hideinput()):(n.attr("type","text"),n.off("focusin blur"))},destroy:function(){e(this).off("blur focusin")}};e.fn.hideinput=function(t){if(n[t])return n[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return n.init.apply(this,arguments);e.error("Method '"+t+"' not found in jQuery.AutoHideInput")},e(document).ready(function(){e('input[data-hide="true"]').hideinput()})})(window.jQuery||window.Zepto||window.$);