diff --git a/app/assets/javascripts/admins.js b/app/assets/javascripts/admins.js index 0dff33ee..cd29fd8e 100644 --- a/app/assets/javascripts/admins.js +++ b/app/assets/javascripts/admins.js @@ -32,10 +32,10 @@ $(document).on('turbolinks:load', function(){ }) //clear the role filter if user clicks on the x - $(".clear-role").click(function(data) { - search = new URL(location.href).searchParams.get('search') + $(".clear-role").click(function() { + var search = new URL(location.href).searchParams.get('search') - url = window.location.pathname + "?page=1" + var url = window.location.pathname + "?page=1" if (search) { url += "&search=" + search @@ -52,8 +52,8 @@ $(document).on('turbolinks:load', function(){ $(this).ColorPickerSetColor(colour); }, - onSubmit: function(_hsb, hex, _rgb, _el) { - $.post($("#coloring-path-regular").val(), {color: '#' + hex}).done(function(data) { + onSubmit: function(_hsb, hex) { + $.post($("#coloring-path-regular").val(), {color: '#' + hex}).done(function() { location.reload() }); }, @@ -65,8 +65,8 @@ $(document).on('turbolinks:load', function(){ $(this).ColorPickerSetColor(colour); }, - onSubmit: function(_hsb, hex, _rgb, _el) { - $.post($("#coloring-path-lighten").val(), {color: '#' + hex}).done(function(data) { + onSubmit: function(_hsb, hex) { + $.post($("#coloring-path-lighten").val(), {color: '#' + hex}).done(function() { location.reload() }); }, @@ -78,8 +78,8 @@ $(document).on('turbolinks:load', function(){ $(this).ColorPickerSetColor(colour); }, - onSubmit: function(_hsb, hex, _rgb, _el) { - $.post($("#coloring-path-darken").val(), {color: '#' + hex}).done(function(data) { + onSubmit: function(_hsb, hex) { + $.post($("#coloring-path-darken").val(), {color: '#' + hex}).done(function() { location.reload() }); }, @@ -108,9 +108,9 @@ function changeBrandingImage(path) { // Filters by role function filterRole(role) { - search = new URL(location.href).searchParams.get('search') + var search = new URL(location.href).searchParams.get('search') - url = window.location.pathname + "?page=1" + "&role=" + role + var url = window.location.pathname + "?page=1" + "&role=" + role if (search) { url += "&search=" + search diff --git a/app/assets/javascripts/search.js b/app/assets/javascripts/search.js index c7d6d8db..de2c0f78 100644 --- a/app/assets/javascripts/search.js +++ b/app/assets/javascripts/search.js @@ -78,9 +78,9 @@ function searchPage() { var action = $("body").data('action'); // Check if the user filtered by role - role = new URL(location.href).searchParams.get('role') + var role = new URL(location.href).searchParams.get('role') - url = window.location.pathname + "?page=1&search=" + search + var url = window.location.pathname + "?page=1&search=" + search if (role) { url += "&role=" + role @@ -99,9 +99,9 @@ function clearSearch() { var controller = $("body").data('controller'); var action = $("body").data('action'); - role = new URL(location.href).searchParams.get('role') + var role = new URL(location.href).searchParams.get('role') - url = window.location.pathname + "?page=1" + var url = window.location.pathname + "?page=1" if (role) { url += "&role=" + role diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index 50adb163..d7e31e7b 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -111,7 +111,7 @@ class AdminsController < ApplicationController # POST /admins/branding def branding @settings.update_value("Branding Image", params[:url]) - redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings.image") } + redirect_to admins_path, flash: { success: I18n.t("administrator.flash.settings") } end # POST /admins/color