Sha256: acefc02b3364ce450aca5a91342bad21cc98460f1c1074bd40e1f071ab0945aa
Contents?: true
Size: 1.71 KB
Versions: 2
Compression:
Stored size: 1.71 KB
Contents
/*! UIkit 2.27.2 | 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(); 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.html($this.options[type=='text' ? 'lblShow':'lblHide']); } }); this.input = this.element.next('input').length ? this.element.next('input') : this.element.prev('input'); this.element.html(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 & 2 rubygems
Version | Path |
---|---|
rails-uikit-sass-2.27.2 | vendor/assets/javascripts/components/form-password.js |
uikit2-rails-0.1.10 | vendor/assets/javascripts/uikit/components/form-password.js |