From 18c991fd4256a4158e7ab4872bc368ed85bceead Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sun, 21 Jul 2013 02:16:58 -0400 Subject: [PATCH] restyling composer window to be smaller widthwise attempted to fix vertical-alignment of post_window relative to taskbar --- public/css/style.less | 1 + public/src/modules/composer.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/public/css/style.less b/public/css/style.less index fb614ba160..53e4d8688e 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -508,6 +508,7 @@ body .navbar .nodebb-inline-block { display: none; > div { + position: absolute; height: 100%; background: rgba(64, 64, 64, 0.6); diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index cc0ae8fbd0..fafaea1e49 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -14,7 +14,7 @@ define(['taskbar'], function(taskbar) { composer.postContainer = document.createElement('div'); composer.postContainer.className = 'post-window row-fluid'; - composer.postContainer.innerHTML = '
' + + composer.postContainer.innerHTML = '
' + '' + '
' + '
' + @@ -158,10 +158,16 @@ define(['taskbar'], function(taskbar) { composer.load = function(post_uuid) { var post_data = composer.posts[post_uuid], titleEl = composer.postContainer.querySelector('input'), - bodyEl = composer.postContainer.querySelector('textarea'); + bodyEl = composer.postContainer.querySelector('textarea'), + postWindowEl = composer.postContainer.querySelector('.span5'), + taskbarBtn = document.querySelector('#taskbar [data-uuid="' + post_uuid + '"]'), + btnRect = taskbarBtn.getBoundingClientRect(), + windowRect; composer.postContainer.style.display = 'block'; - // composer.postContainer.style.bottom = composer.btnContainer.offsetHeight + "px"; + windowRect = postWindowEl.getBoundingClientRect(); + postWindowEl.style.left = (btnRect.left + btnRect.width - windowRect.width) + 'px'; + composer.postContainer.style.bottom = btnRect.height + "px"; composer.postContainer.setAttribute('data-uuid', post_uuid); if (parseInt(post_data.tid) > 0) { titleEl.value = 'Replying to: ' + post_data.title;