Merge pull request #18883 from edx/LEARNER-3832

Account Page refreshes on autosave/combobox Language value change
This commit is contained in:
hamzamunir7300
2018-09-25 18:04:54 +05:00
committed by GitHub
2 changed files with 11 additions and 2 deletions

View File

@@ -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', {

View File

@@ -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);
}