aboutsummaryrefslogtreecommitdiffhomepage
path: root/main/app/sprinkles/account/assets/userfrosting/js/pages/account-settings.js
diff options
context:
space:
mode:
Diffstat (limited to 'main/app/sprinkles/account/assets/userfrosting/js/pages/account-settings.js')
-rwxr-xr-xmain/app/sprinkles/account/assets/userfrosting/js/pages/account-settings.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/main/app/sprinkles/account/assets/userfrosting/js/pages/account-settings.js b/main/app/sprinkles/account/assets/userfrosting/js/pages/account-settings.js
new file mode 100755
index 0000000..8d8d2e7
--- /dev/null
+++ b/main/app/sprinkles/account/assets/userfrosting/js/pages/account-settings.js
@@ -0,0 +1,29 @@
+/**
+ * Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template.
+ * example: {{ assets.js('js/pages/sign-in-or-register') | raw }}
+ *
+ * This script depends on validation rules specified in pages/partials/page.js.twig.
+ *
+ * Target page: account/settings
+ */
+$(document).ready(function() {
+
+ // Apply select2 to locale field
+ $('.js-select2').select2();
+
+ $("#account-settings").ufForm({
+ validators: page.validators.account_settings,
+ msgTarget: $("#alerts-page")
+ }).on("submitSuccess.ufForm", function() {
+ // Reload the page on success
+ window.location.reload();
+ });
+
+ $("#profile-settings").ufForm({
+ validators: page.validators.profile_settings,
+ msgTarget: $("#alerts-page")
+ }).on("submitSuccess.ufForm", function() {
+ // Reload the page on success
+ window.location.reload();
+ });
+});