From a959c5d35fb7bf8baf5f4d80a43c57604397c52f Mon Sep 17 00:00:00 2001 From: Navin Karkera Date: Tue, 11 Oct 2022 18:14:54 +0530 Subject: [PATCH] fix: preview mode navigation previous button (that uses legacy UI) Legacy UI: Previous button should use prev_url if it in first position. In studio UI, it should always use prev_url. To make this possible we checking length of contents which is always zero for studio and more than 0 for legacy UI. --- xmodule/js/src/sequence/display.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmodule/js/src/sequence/display.js b/xmodule/js/src/sequence/display.js index 8c48d29a77..f2d23d57ec 100644 --- a/xmodule/js/src/sequence/display.js +++ b/xmodule/js/src/sequence/display.js @@ -364,7 +364,7 @@ if ((direction === 'next') && (this.position >= this.contents.length)) { targetUrl = this.nextUrl; - } else if ((direction === 'previous')) { + } else if ((direction === 'previous') && (this.position === 1 || this.contents.length === 0)) { targetUrl = this.prevUrl; }