Skip to content

Commit

Permalink
Fixing the devMode variable and fixed #17
Browse files Browse the repository at this point in the history
  • Loading branch information
Alok Shukla committed Apr 17, 2015
1 parent b294218 commit 67b51ea
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

$(document).ready(function() {
var body = $('body');
var devMode = true;
var devMode = window.location.href.indexOf("localhost")>0;

var billGenerated = false;

Expand Down Expand Up @@ -81,7 +81,6 @@ $(document).ready(function() {
};

var clearForms = function() {
// TODO Implement to fix #17
$('form').each(function() {
this.reset();
});
Expand Down Expand Up @@ -129,21 +128,12 @@ $(document).ready(function() {

body.on('click', '.new-bill', function(e) {
if (billGenerated) {
// FIXME #17
if(devMode) {
clearForms();
} else {
location.reload();
}
clearForms();
} else {
// TODO Replace this confirm with bootbox
var result = confirm("This bill has not been generated. Do you still want to continue?");
if(result) {
if(devMode) {
clearForms();
} else {
location.reload();
}
clearForms();
}
}
});
Expand Down

0 comments on commit 67b51ea

Please sign in to comment.