Skip to content

Commit

Permalink
fixed bug that caused the treatment to be added 2 times
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncalabrese committed Mar 18, 2015
1 parent fd47ec9 commit 186fdff
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions static/js/ui-utils.js
Expand Up @@ -150,6 +150,14 @@ function isTouch() {
catch (e) { return false; }
}

function closeDrawer(id, callback) {
openDraw = null;
$(id).animate({right: '-300px'}, 300, function () {
$(id).css('display', 'none');
if (callback) callback();
});
}

function toggleDrawer(id, openCallback, closeCallback) {

function openDrawer(id, callback) {
Expand All @@ -170,14 +178,6 @@ function toggleDrawer(id, openCallback, closeCallback) {

}

function closeDrawer(id, callback) {
openDraw = null;
$(id).animate({right: '-300px'}, 300, function () {
$(id).css('display', 'none');
if (callback) callback();
});
}

if (openDraw == id) {
closeDrawer(id, closeCallback);
} else {
Expand Down Expand Up @@ -294,7 +294,7 @@ function treatmentSubmit(event) {

browserStorage.set('enteredBy', data.enteredBy);

closeTreatmentDrawer();
closeDrawer('#treatmentDrawer');
}

if (event) {
Expand Down

0 comments on commit 186fdff

Please sign in to comment.