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 9e7b227 commit 3ef2309
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 @@ -118,12 +117,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 @@ -140,12 +137,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 @@ -359,6 +354,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 3ef2309

Please sign in to comment.