updated Uikit v2
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
(function(addon) {
|
||||
|
||||
var component;
|
||||
|
||||
if (window.UIkit) {
|
||||
component = addon(UIkit);
|
||||
if (window.UIkit2) {
|
||||
component = addon(UIkit2);
|
||||
}
|
||||
|
||||
if (typeof define == "function" && define.amd) {
|
||||
define("uikit-form-password", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-form-password', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -20,22 +20,22 @@
|
||||
UI.component('formPassword', {
|
||||
|
||||
defaults: {
|
||||
"lblShow": "Show",
|
||||
"lblHide": "Hide"
|
||||
lblShow: 'Show',
|
||||
lblHide: 'Hide'
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
// init code
|
||||
UI.$html.on("click.formpassword.uikit", "[data-uk-form-password]", function(e) {
|
||||
UI.$html.on('click.formpassword.uikit', '[data-uk-form-password]', function(e) {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("formPassword")) {
|
||||
if (!ele.data('formPassword')) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
UI.formPassword(ele, UI.Utils.options(ele.attr("data-uk-form-password")));
|
||||
ele.trigger("click");
|
||||
UI.formPassword(ele, UI.Utils.options(ele.attr('data-uk-form-password')));
|
||||
ele.trigger('click');
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -44,22 +44,22 @@
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.on("click", function(e) {
|
||||
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"]);
|
||||
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.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);
|
||||
this.element.data('formPassword', this);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user