Account Page refreshes on autosave/combobox Language value change
Passing the next field id to focus the next field automatically after the page reload due to the language selection. LEARNER-3832
This commit is contained in:
@@ -168,7 +168,8 @@
|
||||
{platform_name: platformName}
|
||||
),
|
||||
options: fieldsData.language.options,
|
||||
persistChanges: true
|
||||
persistChanges: true,
|
||||
focusNextID: '#u-field-select-country',
|
||||
})
|
||||
},
|
||||
countryFieldView,
|
||||
@@ -388,7 +389,12 @@
|
||||
});
|
||||
|
||||
accountSettingsView.render();
|
||||
|
||||
if( $.cookie('focus_id')) {
|
||||
$($.cookie('focus_id')).attr({"tabindex": 0});
|
||||
$($.cookie('focus_id')).focus();
|
||||
// Deleting the cookie
|
||||
document.cookie = "focus_id=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/account;";
|
||||
}
|
||||
showAccountSettingsPage = function() {
|
||||
// Record that the account settings page was viewed.
|
||||
Logger.log('edx.user.settings.viewed', {
|
||||
|
||||
@@ -143,6 +143,9 @@
|
||||
this.showNotificationMessage(successMessage);
|
||||
|
||||
if (this.options.refreshPageOnSave) {
|
||||
if ("focusNextID" in this.options) {
|
||||
$.cookie('focus_id', this.options.focusNextID );
|
||||
}
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user