Skip to content

Commit

Permalink
Merge pull request #675 from rdmorganiser/dev-2.0.0+fix-next-prev
Browse files Browse the repository at this point in the history
Fix prev and next in interview
  • Loading branch information
jochenklar authored Aug 18, 2023
2 parents 4aaa4da + 0e49651 commit 777e4e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .ignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ migrations

*.xml
*.json
*.po
*.mo
12 changes: 6 additions & 6 deletions rdmo/projects/static/projects/js/project_questions/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -837,28 +837,28 @@ angular.module('project_questions')

service.prev = function() {
service.error = null; // reset error when moving to previous questionset
if (service.page.prev !== null) {
if (service.page.prev_page !== null) {
if (service.settings.project_questions_autosave) {
service.save(false).then(function() {
back = true;
service.initView(service.page.prev);
service.initView(service.page.prev_page);
})
} else {
back = true;
service.initView(service.page.prev);
service.initView(service.page.prev_page);
}
}
};

service.next = function() {
service.error = null; // reset error when moving to next questionset
if (service.page.id !== null) {
if (service.page.next_page !== null) {
if (service.settings.project_questions_autosave) {
service.save(false).then(function() {
service.initView(service.page.next);
service.initView(service.page.next_page);
})
} else {
service.initView(service.page.next);
service.initView(service.page.next_page);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div class="pull-right">
<div ng-hide="service.project.read_only || service.page.elements.length < 1">
{% if settings.PROJECT_QUESTIONS_AUTOSAVE %}
<button type="button" ng-click="service.prev()" ng-disabled="!service.page.prev"
<button type="button" ng-click="service.prev()" ng-disabled="!service.page.prev_page"
class="btn btn-default">
{% trans 'Back' %}
</button>
Expand Down

0 comments on commit 777e4e1

Please sign in to comment.