# HG changeset patch # User Nicholas Jillings # Date 1505226502 -3600 # Node ID 664065577426dd15a2989b974460c6d8c6d55d3e # Parent f06405eacbe1748f9ede2f80dd3dfd7b68a664ce Hide the back button #232 diff -r f06405eacbe1 -r 664065577426 js/core.js --- a/js/core.js Tue Sep 12 14:36:51 2017 +0100 +++ b/js/core.js Tue Sep 12 15:28:22 2017 +0100 @@ -1099,7 +1099,7 @@ } else { this.buttonProceed.textContent = 'Next'; } - if (this.currentIndex > 0) + if (this.currentIndex > 0 && this.node.showBackButton) this.buttonPrevious.style.visibility = 'visible'; else this.buttonPrevious.style.visibility = 'hidden'; diff -r f06405eacbe1 -r 664065577426 js/specification.js --- a/js/specification.js Tue Sep 12 14:36:51 2017 +0100 +++ b/js/specification.js Tue Sep 12 15:28:22 2017 +0100 @@ -216,6 +216,7 @@ this.location = undefined; this.options = []; this.parent = undefined; + this.showBackButton = true; this.specification = specification; this.addOption = function () { @@ -403,6 +404,12 @@ } else if (this.location == 'after') { this.location = 'post'; } + this.showBackButton = xml.getAttribute("showBackButton"); + if (this.showBackButton == "false") { + this.showBackButton = false; + } else { + this.showBackButton = true; + } var child = xml.firstElementChild; while (child) { var node = new this.OptionNode(this.specification); diff -r f06405eacbe1 -r 664065577426 xml/test-schema.xsd --- a/xml/test-schema.xsd Tue Sep 12 14:36:51 2017 +0100 +++ b/xml/test-schema.xsd Tue Sep 12 15:28:22 2017 +0100 @@ -547,6 +547,7 @@ +