diff test_create/test_core.js @ 2986:f99b888f57e9

Possible fix for #272
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 10 Apr 2018 10:18:25 +0100
parents 1593792ae742
children 1ae8c03dd6a6
line wrap: on
line diff
--- a/test_create/test_core.js	Tue Apr 10 09:38:05 2018 +0100
+++ b/test_create/test_core.js	Tue Apr 10 10:18:25 2018 +0100
@@ -85,6 +85,7 @@
     get("xml/test-schema.xsd").then(function (text) {
         specification.processSchema(text);
         $s.globalSchema = specification.getSchema();
+        $s.$apply();
     });
     $s.availableInterfaceModules = [];
     get("interfaces/interfaces.json").then(JSON.parse).then(function (d) {
@@ -179,7 +180,7 @@
     $s.selected = undefined;
     $s.next = function () {
         $s.state++;
-        if ($s.state > 1 || $s.file) {
+        if ($s.state > 2 || $s.file) {
             $s.hidePopup();
             $s.initialise($s.selected);
         }
@@ -187,6 +188,15 @@
     $s.back = function () {
         $s.state--;
     };
+
+    $s.$watch(function () {
+        return ($s.globalSchema !== undefined)
+    }, function () {
+        if ($s.globalSchema !== undefined && $s.state === 0) {
+            $s.state = 1;
+        }
+    })
+
     $s.mouseover = function (name) {
         var obj = $s.testSpecifications.interfaces.find(function (i) {
             return i.name == name;
@@ -211,9 +221,9 @@
         }
     };
     $s.select = function (name) {
-        $s.selected = name;
-    }
-    // Get the test interface specifications
+            $s.selected = name;
+        }
+        // Get the test interface specifications
     $s.file = undefined;
     $s.description = "";