Revision 3880:e6d1f6d9d7df,
513 bytes
checked in by franck <carnet.franck.paul@…>, 7 years ago
(diff) |
Use let and const rather than var (ES2015/ES6), use template string where is more efficient
|
Rev | Line | |
---|
[3706] | 1 | /*global $ */ |
---|
| 2 | 'use strict'; |
---|
| 3 | |
---|
[0] | 4 | $(function() { |
---|
[3685] | 5 | if ($('#new_pwd').length == 0) { |
---|
| 6 | return; |
---|
| 7 | } |
---|
[3880] | 8 | const user_email = $('#user_email').val(); |
---|
[3685] | 9 | $('#user-form').submit(function() { |
---|
[3706] | 10 | var e = this.elements.cur_pwd; |
---|
[3685] | 11 | if (e.value != '') { |
---|
| 12 | return true; |
---|
| 13 | } |
---|
| 14 | if ($('#user_email').val() != user_email || $('#new_pwd').val() != '') { |
---|
| 15 | $(e).addClass('missing').focusout(function() { |
---|
[3706] | 16 | $(this).removeClass('missing'); |
---|
[3685] | 17 | }); |
---|
| 18 | e.focus(); |
---|
| 19 | return false; |
---|
| 20 | } |
---|
| 21 | return true; |
---|
| 22 | }); |
---|
[2566] | 23 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.