minor tweaks to positioning of composer window relative to taskbar

v1.18.x
Julian Lam 12 years ago
parent 7619fec78d
commit a66f2dfabe

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

Loading…
Cancel
Save