Repository: airavata-php-gateway Updated Branches: refs/heads/develop 9fefa3d48 -> c47570ac9
fixing bug Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/c47570ac Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/c47570ac Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/c47570ac Branch: refs/heads/develop Commit: c47570ac9a2282ee87841f7810b555dfc8683ee9 Parents: 9fefa3d Author: scnakandala <[email protected]> Authored: Mon May 22 16:08:10 2017 -0400 Committer: scnakandala <[email protected]> Committed: Mon May 22 16:08:10 2017 -0400 ---------------------------------------------------------------------- .../partials/experiment-queue-block.blade.php | 40 +++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/c47570ac/app/views/partials/experiment-queue-block.blade.php ---------------------------------------------------------------------- diff --git a/app/views/partials/experiment-queue-block.blade.php b/app/views/partials/experiment-queue-block.blade.php index 14d17ae..6f844fa 100644 --- a/app/views/partials/experiment-queue-block.blade.php +++ b/app/views/partials/experiment-queue-block.blade.php @@ -155,6 +155,24 @@ getQueueData(selectedQueue); }); + function nodeCountOnKeyUp(){ + var nodeCount=$("#node-count"); + var cpuCount=$("#cpu-count"); + var nodeCountVal = parseInt(nodeCount.val()); + if(nodeCountVal > 0){ + cpuCount.val(nodeCountVal*cpusPerNode); + } + } + + function cpuCountOnKeyUp(){ + var nodeCount=$("#node-count"); + var cpuCount=$("#cpu-count"); + var cpuCountVal = parseInt(cpuCount.val()); + if(cpuCountVal > 0){ + nodeCount.val(Math.ceil(cpuCountVal/cpusPerNode)); + } + } + function getQueueData(selectedQueue) { var queues = $.parseJSON($("#queue-array").val()); var queueDefaults = $.parseJSON($("#queue-defaults-array").val()); @@ -240,26 +258,12 @@ var cpusPerNode = queueDefaults['cpusPerNode']; } - var nodeCount=$("#node-count"); - var cpuCount=$("#cpu-count"); - if(cpusPerNode > 0){ - nodeCount.keyup(function(){ - var nodeCountVal = parseInt(nodeCount.val()); - if(nodeCountVal > 0){ - cpuCount.val(nodeCountVal*cpusPerNode); - } - }); - - cpuCount.keyup(function(){ - var cpuCountVal = parseInt(cpuCount.val()); - if(cpuCountVal > 0){ - nodeCount.val(Math.ceil(cpuCountVal/cpusPerNode)); - } - }); + nodeCount.keyup(nodeCountOnKeyUp); + cpuCount.keyup(cpuCountOnKeyUp); }else{ - nodeCount.onkeyup = null; - cpuCount.onkeyup = null; + nodeCount.unbind('keyup', nodeCountOnKeyUp); + cpuCount.unbind('keyup', cpuCountOnKeyUp); } } }
