From cfb873bb4f3c1b3f1984c82ea87078376d7de880 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 9 Nov 2021 22:47:19 +1100 Subject: [PATCH] Bug fix for loading part table without enabling grid view --- InvenTree/templates/js/translated/part.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index 742083bbe4..dc1adf8837 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -992,7 +992,7 @@ function loadPartTable(table, url, options={}) { } }); - var grid_view = inventreeLoad('part-grid-view') == 1; + var grid_view = options.gridView && inventreeLoad('part-grid-view') == 1; $(table).inventreeTable({ url: url, @@ -1020,7 +1020,7 @@ function loadPartTable(table, url, options={}) { $('#view-part-list').removeClass('btn-outline-secondary').addClass('btn-secondary'); } }, - buttons: [ + buttons: options.gridView ? [ { icon: 'fas fa-bars', attributes: { @@ -1053,7 +1053,7 @@ function loadPartTable(table, url, options={}) { ); } } - ], + ] : [], customView: function(data) { var html = '';