From 4a4e17a8f3c1a7208fd5701e8663e5ba0a79a625 Mon Sep 17 00:00:00 2001 From: Suresh Alse Date: Mon, 15 Jun 2015 14:32:45 +0530 Subject: [PATCH] unbind the click event --- package.json | 2 +- public/js/script.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6f77f30..5b3020e 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crontab-ui", - "version": "0.1.1", + "version": "0.1.3", "description": "Easy and safe way to manage your crontab file", "main": "index.js", "scripts": { diff --git a/public/js/script.js b/public/js/script.js index fcb2e53..322a86b 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -78,6 +78,7 @@ function editJob(_id){ job_string(); } + $("#job-save").unbind("click"); // remove existing events attached to this $("#job-save").click(function(){ // TODO good old boring validations $.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: _id}, function(){ @@ -99,6 +100,7 @@ function newJob(){ $("#job-name").val(""); $("#job-command").val(""); job_string(); + $("#job-save").unbind("click"); // remove existing events attached to this $("#job-save").click(function(){ // TODO good old boring validations $.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: -1}, function(){