unbind the click event

v0.1.3
Suresh Alse 2015-06-15 14:32:45 +05:30
parent 1245f0560a
commit 4a4e17a8f3
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "crontab-ui", "name": "crontab-ui",
"version": "0.1.1", "version": "0.1.3",
"description": "Easy and safe way to manage your crontab file", "description": "Easy and safe way to manage your crontab file",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -78,6 +78,7 @@ function editJob(_id){
job_string(); job_string();
} }
$("#job-save").unbind("click"); // remove existing events attached to this
$("#job-save").click(function(){ $("#job-save").click(function(){
// TODO good old boring validations // TODO good old boring validations
$.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: _id}, function(){ $.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-name").val("");
$("#job-command").val(""); $("#job-command").val("");
job_string(); job_string();
$("#job-save").unbind("click"); // remove existing events attached to this
$("#job-save").click(function(){ $("#job-save").click(function(){
// TODO good old boring validations // TODO good old boring validations
$.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: -1}, function(){ $.post(routes.save, {name: $("#job-name").val(), command: job_command , schedule: schedule, _id: -1}, function(){