Skip to content

Commit

Permalink
fix(form): sort not applied on 1st display
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Mar 12, 2021
1 parent 2cc0288 commit cfe5347
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions js/scripts.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
});

Expand All @@ -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);
});

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit cfe5347

Please sign in to comment.