@@ -46070,6 +46070,11 @@ CUI.Input = (function(superClass) {
46070
46070
},
46071
46071
appearance: {
46072
46072
check: ["code"]
46073
+ },
46074
+ controlElement: {
46075
+ check: function(v) {
46076
+ return v instanceof CUI.DOMElement;
46077
+ }
46073
46078
}
46074
46079
});
46075
46080
};
@@ -46932,6 +46937,9 @@ CUI.Input = (function(superClass) {
46932
46937
var j, k, len1, ref;
46933
46938
Input.__super__.render.call(this);
46934
46939
this.replace(this.__createElement(), this.getTemplateKeyForRender());
46940
+ if (this._controlElement) {
46941
+ this.append(this._controlElement, this.getTemplateKeyForRender());
46942
+ }
46935
46943
ref = ["empty", "invalid", "valid"];
46936
46944
for (j = 0, len1 = ref.length; j < len1; j++) {
46937
46945
k = ref[j];
@@ -58730,6 +58738,36 @@ CUI.Password = (function(superClass) {
58730
58738
return Password.__super__.constructor.apply(this, arguments);
58731
58739
}
58732
58740
58741
+ Password.prototype.initOpts = function() {
58742
+ Password.__super__.initOpts.call(this);
58743
+ return this.addOpts({
58744
+ toggleButton: {
58745
+ "default": false,
58746
+ check: Boolean
58747
+ }
58748
+ });
58749
+ };
58750
+
58751
+ Password.prototype.readOpts = function() {
58752
+ Password.__super__.readOpts.call(this);
58753
+ if (this._toggleButton) {
58754
+ return this._controlElement = new CUI.Button({
58755
+ icon: "fa-eye",
58756
+ onClick: (function(_this) {
58757
+ return function(ev, btn) {
58758
+ if (CUI.dom.getAttribute(_this.__input, "type") === "password") {
58759
+ btn.setIcon("fa-eye-slash");
58760
+ return _this.showPassword();
58761
+ } else {
58762
+ btn.setIcon("fa-eye");
58763
+ return _this.hidePassword();
58764
+ }
58765
+ };
58766
+ })(this)
58767
+ });
58768
+ }
58769
+ };
58770
+
58733
58771
Password.prototype.__createElement = function() {
58734
58772
return Password.__super__.__createElement.call(this, "password");
58735
58773
};
0 commit comments