diff --git a/README.md b/README.md index 2d6d23c..1aa211c 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,7 @@ Here are all of the available options and their defaults: attr: { role: 'button', 'aria-label': 'Show Password', + title: 'Show Password', tabIndex: 0 } }, @@ -270,7 +271,10 @@ Here are all of the available options and their defaults: toggle: { className: 'hideShowPassword-toggle-hide', content: 'Hide', - attr: { 'aria-pressed': 'true' } + attr: { + 'aria-pressed': 'true' + title: 'Hide Password', + } } }, hidden: { @@ -280,7 +284,10 @@ Here are all of the available options and their defaults: toggle: { className: 'hideShowPassword-toggle-show', content: 'Show', - attr: { 'aria-pressed': 'false' } + attr: { + 'aria-pressed': 'false', + title: 'Show Password', + } } } } diff --git a/hideShowPassword.js b/hideShowPassword.js index 5174fb9..db84add 100644 --- a/hideShowPassword.js +++ b/hideShowPassword.js @@ -112,6 +112,7 @@ attr: { role: 'button', 'aria-label': 'Show Password', + title: 'Show Password', tabIndex: 0 } }, @@ -162,7 +163,10 @@ toggle: { className: 'hideShowPassword-toggle-hide', content: 'Hide', - attr: { 'aria-pressed': 'true' } + attr: { + 'aria-pressed': 'true', + title: 'Hide Password' + } } }, hidden: { @@ -172,7 +176,10 @@ toggle: { className: 'hideShowPassword-toggle-show', content: 'Show', - attr: { 'aria-pressed': 'false' } + attr: { + 'aria-pressed': 'false', + title: 'Show Password' + } } } } diff --git a/hideShowPassword.min.js b/hideShowPassword.min.js index b061f49..d901d26 100644 --- a/hideShowPassword.min.js +++ b/hideShowPassword.min.js @@ -1 +1 @@ -(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports==="object"){factory(require("jquery"))}else{factory(jQuery)}})(function($,undef){var dataKey="plugin_hideShowPassword",shorthandArgs=["show","innerToggle"],SPACE=32,ENTER=13;var canSetInputAttribute=function(){var body=document.body,input=document.createElement("input"),result=true;if(!body){body=document.createElement("body")}input=body.appendChild(input);try{input.setAttribute("type","text")}catch(e){result=false}body.removeChild(input);return result}();var defaults={show:"infer",innerToggle:false,enable:canSetInputAttribute,className:"hideShowPassword-field",initEvent:"hideShowPasswordInit",changeEvent:"passwordVisibilityChange",props:{autocapitalize:"off",autocomplete:"off",autocorrect:"off",spellcheck:"false"},toggle:{element:'