changeset 3020:664065577426

Hide the back button #232
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 12 Sep 2017 15:28:22 +0100
parents f06405eacbe1
children a5a6c44bab6e
files js/core.js js/specification.js xml/test-schema.xsd
diffstat 3 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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';
--- 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);
--- 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 @@
                         </xs:restriction>
                     </xs:simpleType>
                 </xs:attribute>
+                <xs:attribute name="showBackButton" type="xs:boolean" default="true" />
             </xs:complexType>
         </xs:element>