Sha256: 508c3554c86c0de9a5bad2b6685dfe6fd45566a8ec161950f56b44f574c0af37
Contents?: true
Size: 1.73 KB
Versions: 2
Compression:
Stored size: 1.73 KB
Contents
/*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ (function(addon) { var component; if (window.UIkit) { component = addon(UIkit); } if (typeof define == "function" && define.amd) { define("uikit-form-password", ["uikit"], function(){ return component || addon(UIkit); }); } })(function(UI){ "use strict"; UI.component('formPassword', { defaults: { "lblShow": "Show", "lblHide": "Hide" }, boot: function() { // init code UI.$html.on("click.formpassword.uikit", "[data-uk-form-password]", function(e) { var ele = UI.$(this); if (!ele.data("formPassword")) { e.preventDefault(); var obj = UI.formPassword(ele, UI.Utils.options(ele.attr("data-uk-form-password"))); ele.trigger("click"); } }); }, init: function() { var $this = this; this.on("click", function(e) { e.preventDefault(); if($this.input.length) { var type = $this.input.attr("type"); $this.input.attr("type", type=="text" ? "password":"text"); $this.element.text($this.options[type=="text" ? "lblShow":"lblHide"]); } }); this.input = this.element.next("input").length ? this.element.next("input") : this.element.prev("input"); this.element.text(this.options[this.input.is("[type='password']") ? "lblShow":"lblHide"]); this.element.data("formPassword", this); } }); return UI.formPassword; });
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
uikit-sass-rails-1.4.1 | vendor/assets/javascripts/uikit/components/form-password.js |
uikit-sass-rails-1.4.0 | vendor/assets/javascripts/uikit/components/form-password.js |