From 8dd8536f6ba3e526cc1e465bc4eb436b3c2ad6da Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sun, 29 Sep 2013 20:38:45 -0400 Subject: [PATCH] closes #317 - hitting discard on a post with content will now throw a bootbox confirmation modal --- public/src/modules/composer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index 8326ec0245..924cf94fec 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -187,7 +187,15 @@ define(['taskbar'], function(taskbar) { switch(action) { case 'post': composer.post(uuid); break; case 'minimize': composer.minimize(uuid); break; - case 'discard': composer.discard(uuid); break; + case 'discard': + if (postContentEl.value.length > 0) { + bootbox.confirm('Are you sure you wish to discard this post?', function(discard) { + if (discard) composer.discard(uuid); + }); + } else { + composer.discard(uuid); + } + break; } });