From 6d5ea9015bfc97da9060bd13683a9695cdbc8257 Mon Sep 17 00:00:00 2001
From: Morgan Rodgers <mrodgers@osc.edu>
Date: Thu, 21 Feb 2019 13:31:34 -0500
Subject: [PATCH] Fix front end to allow ppn control to remain blank

---
 form.js  | 10 +++++++---
 form.yml |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/form.js b/form.js
index e074fd9..65d8c46 100644
--- a/form.js
+++ b/form.js
@@ -1,14 +1,18 @@
 'use strict'
 
 /**
- * Fix num cores
+ * Fix num cores, allowing blanks to remain
  */
 function fix_num_cores() {
   let node_type_input = $('#batch_connect_session_context_node_type');
   let node_type = node_type_input.val();
   let num_cores_input = $('#num_cores');
-  
-  if(node_type === ':hugemem') {
+
+  if(num_cores_input.val() === '') {
+    return;
+  }
+
+  if(node_type === 'hugemem') {
     set_ppn_owens_hugemem(num_cores_input);
   } else {
     set_ppn_owens_regular(num_cores_input);
diff --git a/form.yml b/form.yml
index 0d64dde..526ab27 100644
--- a/form.yml
+++ b/form.yml
@@ -17,7 +17,7 @@ attributes:
     help: |
       Number of cores on node type (4 GB per core unless requesting whole
       node). Leave blank if requesting full node.
-    min: 1
+    min: 0
     max: 48
     step: 1
     id: 'num_cores'
-- 
GitLab