Skip to content

Commit

Permalink
Make sure back button is enabled when litsMode == All
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed Jan 27, 2023
1 parent 36e759e commit 828ddda
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -194,7 +194,7 @@
pageSize = $pageContents.data('pageSize'),
currentQuestion = $pageContents.data('currentQuestion'),
questions = $pageContents.data('questions');

if (listMode || listMode == 'all')
{
if (pageMode || (pageMode == undefined && listMode == true))
Expand Down Expand Up @@ -494,6 +494,9 @@
{
this.loadQuestions();
}
else {
$("#backBtn").button("enable");
}
};

this.trackQuestion = function(currentQuestion, goingBack)
Expand Down Expand Up @@ -750,6 +753,11 @@

if ($pageContents.data('listMode') && x_currentPageXML.getAttribute("pagesize") != undefined) {
$pageContents.data('pageSize', parseInt(x_currentPageXML.getAttribute("pagesize")));
if ($pageContents.data('listMode') === 'all') {
// Set page size to number of items
const numberOfQuestions = $(x_currentPageXML).children().children().length; // Can't be 0
$pageContents.data('pageSize', numberOfQuestions);
}
}
else {
$pageContents.data('pageSize', 1);
Expand Down

0 comments on commit 828ddda

Please sign in to comment.