From 2acd40a8bbd628b0ff59822b03f106fb6c779a5c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 8 May 2013 16:05:54 -0400 Subject: [PATCH] fixing up the post window to extend the body when opened, so it doesn't clip stuff --- public/css/style.less | 10 ++++++++++ public/src/app.js | 8 +++++--- public/templates/footer.tpl | 9 +++++++++ public/templates/header.tpl | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/public/css/style.less b/public/css/style.less index bd7d559bae..bdc90db87c 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -21,6 +21,15 @@ body { background: #fdfdfd; + -webkit-transition: margin-bottom 250ms ease; + -moz-transition: margin-bottom 250ms ease; + -ms-transition: margin-bottom 250ms ease; + -o-transition: margin-bottom 250ms ease; + transition: margin-bottom 250ms ease; + + &.composing { + margin-bottom: 350px; + } } .none { @@ -72,6 +81,7 @@ footer.footer { left: 0px; bottom: 0px; background: white; + z-index: 1500; input { width: 100%; diff --git a/public/src/app.js b/public/src/app.js index 4a989e06bd..88b2b51f24 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -100,9 +100,10 @@ var socket, reply_title = reply_title || document.getElementById('reply_title'); post_content = post_content || document.getElementById('post_content'); - post_window = post_window || document.getElementById('post_window'); - jQuery(post_window).slideToggle(250); + + jQuery(post_window).slideDown(250); + $(document.body).addClass('composing'); if (post_mode == 'topic') { post_title.style.display = "block"; @@ -149,7 +150,7 @@ var socket, 'topic_id' : topic_id, 'content' : content }); - jQuery(post_window).slideToggle(250); + jQuery(post_window).slideDown(250); }; app.post_topic = function(category_id) { @@ -175,6 +176,7 @@ var socket, jQuery('#post_title, #post_content').val(''); jQuery(post_window).slideToggle(250); + $(document.body).addClass('composing'); }; diff --git a/public/templates/footer.tpl b/public/templates/footer.tpl index f23c07ad7e..24d2e3001b 100644 --- a/public/templates/footer.tpl +++ b/public/templates/footer.tpl @@ -76,6 +76,15 @@ right_menu.appendChild(loginEl); } }); + + + // Post window events + var postWindowEl = document.getElementById('post_window'), + discardEl = document.getElementById('discard-post'); + discardEl.addEventListener('click', function() { + $(postWindowEl).slideToggle(250); + $(document.body).removeClass('composing'); + }, false); }()); diff --git a/public/templates/header.tpl b/public/templates/header.tpl index 401c12113b..44b7dd93d7 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -64,7 +64,7 @@
Submit - Discard + Discard