diff --git a/js/scripts.js.php b/js/scripts.js.php index e2b1d9647..628d245d1 100644 --- a/js/scripts.js.php +++ b/js/scripts.js.php @@ -37,7 +37,6 @@ var modalWindow; var rootDoc = CFG_GLPI['root_doc']; var currentCategory = "0"; -var sortByName = false; var tiles = []; var serviceCatalogEnabled = false; var slinkyCategories; @@ -119,12 +118,10 @@ function(event) { // Setup events $('.plugin_formcreator_sort [value=mostPopularSort]').click(function () { - sortByName = false; showTiles(tiles); }); $('.plugin_formcreator_sort [value=alphabeticSort]').click(function () { - sortByName = true; showTiles(tiles); }); @@ -141,12 +138,10 @@ function(event) { // Setup events $('.plugin_formcreator_sort input[value=mostPopularSort]').click(function () { - sortByName = false; showTiles(tiles); }); $('.plugin_formcreator_sort input[value=alphabeticSort]').click(function () { - sortByName = true; showTiles(tiles); }); @@ -360,6 +355,7 @@ function sortFormAndFaqItems(items, byName) { } function showTiles(tiles, defaultForms) { + var sortByName = $('#plugin_formcreator_alphabetic').prop('checked') var tiles = sortFormAndFaqItems(tiles, sortByName); var html = ''; if (defaultForms) {