From 4b6df33d8526517d893f000cc155f7ef781cbf54 Mon Sep 17 00:00:00 2001 From: Meleeman01 Date: Sat, 22 Jun 2019 22:07:11 -0500 Subject: [PATCH] removed extraneous code --- laravel/resources/js/admin.js | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/laravel/resources/js/admin.js b/laravel/resources/js/admin.js index eeb2888a..01f32c50 100644 --- a/laravel/resources/js/admin.js +++ b/laravel/resources/js/admin.js @@ -38,16 +38,6 @@ $(document).ready(function() }); - //A variable here to store previous form data. - var prevData = []; - $('.user-roles input').each(function() - { - if($(this).prop('checked')) - { - prevData.push($(this).value()); - } - }); - // Display save / cancel buttons when changing user roles $('.user-roles input').on('change', function() { @@ -68,7 +58,6 @@ $(document).ready(function() $('.save-roles').on('click', function() { - prevData = []; var user = $('.user-id').value(); var role = $('.user-role').value(); var csrf = $('.csrf-token').value(); @@ -96,23 +85,7 @@ $(document).ready(function() $('.cancel-roles').on('click', function() { - $('.user-role').value($('.user-role').data('role')); - $('.buttons').attr('style', false); - - //pull data array from earlier and assign the values based on prevData - $('.user-roles input').each(function(self) - { - self = $(this); - self.prop('checked',false); - - prevData.forEach(function(el) - { - if (self.value() === el) - { - self.prop('checked',true); - } - }); - }); + window.history.back(); }); $('.save-upload').on('click', function()