From a66f2dfabe46bce0a3924f8d5d4e96b3a3ec31ed Mon Sep 17 00:00:00 2001
From: Julian Lam <julian.lam@gmail.com>
Date: Sun, 21 Jul 2013 02:34:04 -0400
Subject: [PATCH] minor tweaks to positioning of composer window relative to
 taskbar

---
 public/src/modules/composer.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js
index fafaea1e49..0d5445fb1e 100644
--- a/public/src/modules/composer.js
+++ b/public/src/modules/composer.js
@@ -162,12 +162,14 @@ define(['taskbar'], function(taskbar) {
 			postWindowEl = composer.postContainer.querySelector('.span5'),
 			taskbarBtn = document.querySelector('#taskbar [data-uuid="' + post_uuid + '"]'),
 			btnRect = taskbarBtn.getBoundingClientRect(),
-			windowRect;
+			taskbarRect = document.getElementById('taskbar').getBoundingClientRect(),
+			windowRect, leftPos;
 
 		composer.postContainer.style.display = 'block';
 		windowRect = postWindowEl.getBoundingClientRect();
-		postWindowEl.style.left = (btnRect.left + btnRect.width - windowRect.width) + 'px';
-		composer.postContainer.style.bottom = btnRect.height + "px";
+		leftPos = btnRect.left + btnRect.width - windowRect.width;
+		postWindowEl.style.left = (leftPos > 0 ? leftPos : 0) + 'px';
+		composer.postContainer.style.bottom = taskbarRect.height + "px";
 		composer.postContainer.setAttribute('data-uuid', post_uuid);
 		if (parseInt(post_data.tid) > 0) {
 			titleEl.value = 'Replying to: ' + post_data.title;