@@ -339,6 +355,14 @@
this.eventInit();
this.refreshImages();
var wrap = this.dom.closest('div.use-type');
+ var readonly = wrap.attr('readonly');
+ if (readonly) {
+ this.dom.find('.phone-area-c select').attr('disabled', true);
+ this.dom.find('.phone-num-c input').attr('disabled', true);
+ this.dom.find('.slide-bar-wrap').hide();
+ this.dom.find('.verify-code-c').hide();
+ this.dom.find('.modify-phone-number').show();
+ }
var oldPhoneNum = wrap.attr('ophonenumber');
if (oldPhoneNum) {
this.dom.find('input.phoneNumber').val(oldPhoneNum);
@@ -362,7 +386,7 @@
var verifyCodeNoRequired = wrap.attr('verifycodenorequired');
if (verifyCodeNoRequired) {
this.dom.find('input.verifyCode').removeAttr('required');
- }
+ }
};
PhoneVerifyCode.prototype.eventInit = function () {
@@ -444,10 +468,10 @@
},
error: function(err) {
self.dom.find('.slide-bar').addClass('error');
- self.dom.find('.slide-trigger').addClass('error');
- setTimeout(function () {
- self.refreshImages();
- }, 300);
+ self.dom.find('.slide-trigger').addClass('error');
+ setTimeout(function () {
+ self.refreshImages();
+ }, 300);
}
});
}
@@ -487,13 +511,17 @@
if (res && res.Code === 0) {
self.countDown();
} else {
- $('body').toast({
- message: res.Message,
- showProgress: 'bottom',
- showIcon:'warning circle',
- class: 'warning',
- position: 'top right',
- });
+ if ($('.ui.negative.message').length) {
+ $('.ui.negative.message').eq(0).show().find('p').text(res.Message);
+ } else {
+ $('body').toast({
+ message: res.Message,
+ showProgress: 'bottom',
+ showIcon:'warning circle',
+ class: 'warning',
+ position: 'top right',
+ });
+ }
self.refreshImages();
}
},
@@ -503,6 +531,14 @@
});
}
});
+
+ this.dom.find('.modify-phone-number a').on('click', function() {
+ self.dom.find('.phone-area-c select').attr('disabled', false);
+ self.dom.find('.phone-num-c input').attr('disabled', false);
+ self.dom.find('.slide-bar-wrap').css('display', 'flex');
+ self.dom.find('.verify-code-c').css('display', 'flex');
+ self.dom.find('.modify-phone-number').hide();
+ });
};
PhoneVerifyCode.prototype.refreshImages = function () {
diff --git a/templates/user/auth/signin_navbar.tmpl b/templates/user/auth/signin_navbar.tmpl
index 45475e46f..f53f6a820 100755
--- a/templates/user/auth/signin_navbar.tmpl
+++ b/templates/user/auth/signin_navbar.tmpl
@@ -1,8 +1,10 @@
{{if or .EnableOpenIDSignIn .EnableSSPI .EnableCloudBrain}}