Skip to content

Commit 17d0dba

Browse files
ternary operator used instead of ifelse
1 parent 0dd3eeb commit 17d0dba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/code/Magento/Customer/view/frontend/web/js/show-password.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ define([
3939
* @private
4040
*/
4141
_showPassword: function () {
42-
if ($(this.options.passwordSelector).attr("type") == this.options.passwordInputType) {
43-
$(this.options.passwordSelector).attr("type", this.options.textInputType);
44-
} else {
45-
$(this.options.passwordSelector).attr("type", this.options.passwordInputType);
46-
}
42+
var passwordField = this.options.passwordSelector;
43+
$(passwordField).attr(
44+
"type",
45+
($(passwordField).attr("type") == this.options.passwordInputType) ? this.options.textInputType : this.options.passwordInputType
46+
);
4747
}
4848
});
4949
});

0 commit comments

Comments
 (0)