* @author Brady Miller * @copyright Copyright (c) 2018 Ranganath Pathak * @copyright Copyright (c) 2018 Brady Miller * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ // ensure that $user_settings_php_path, $arr_files_php variables are set in the script calling this script use OpenEMR\Common\Csrf\CsrfUtils; ?> $(function() { $('.expand_contract').click(function() { var elementTitle = $(this).prop('title'); var contractTitle = ; var expandTitle = ; var arrFiles = ; if (elementTitle == contractTitle) { elementTitle = expandTitle; $(this).toggleClass('fa-expand fa-compress'); $('.expandable').toggleClass('container container-fluid'); if ($(arrFiles).length) { $.each(arrFiles, function (index, value) { $.post( "/library/ajax/user_settings.php", { target: arrFiles[index].trim(), setting: 0, csrf_token_form: } ); }); } } else if (elementTitle == expandTitle) { elementTitle = contractTitle; $(this).toggleClass('fa-compress fa-expand'); $('.expandable').toggleClass('container-fluid container'); if ($(arrFiles).length) { $.each(arrFiles, function (index, value) { $.post( "/library/ajax/user_settings.php", { target: arrFiles[index].trim(), setting: 1, csrf_token_form: } ); }); } } $(this).prop('title', elementTitle); }); });