Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 72c56e5

Browse files
committed
漏掉 account.js
1 parent 3f7e578 commit 72c56e5

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// 账号(登录/注册/忘记密码等)相关js功能
2+
(function(){
3+
SG.Register = function(){}
4+
SG.Register.prototype = new SG.Publisher();
5+
6+
jQuery(document).ready(function($) {
7+
// 同步提交
8+
$('.submit').on('click', function(evt){
9+
evt.preventDefault();
10+
var $form = $(this).parents('.validate-form');
11+
var validator = $form.validate();
12+
if (!validator.form()) {
13+
return false;
14+
}
15+
16+
$form.submit();
17+
});
18+
19+
var origSrc = '';
20+
$('#captcha_img').on('click', function(evt){
21+
evt.preventDefault();
22+
23+
if (origSrc == '') {
24+
origSrc = $(this).attr("src");
25+
}
26+
$(this).attr("src", origSrc+"?reload=" + (new Date()).getTime());
27+
});
28+
29+
// 异步提交
30+
$('#register-submit').on('click', function(evt){
31+
evt.preventDefault();
32+
var validator = $('.validate-form').validate();
33+
if (!validator.form()) {
34+
return false;
35+
}
36+
37+
new SG.Register().publish(this);
38+
});
39+
});
40+
}).call(this)

0 commit comments

Comments
 (0)