From 9ab31d0a2b83e8f44282fa346b7c000c325c033c Mon Sep 17 00:00:00 2001
From: Asaad Mahmood <asaad@spinpunch.com>
Date: Mon, 21 Dec 2015 20:57:03 +0500
Subject: Multiple UI Improvements

---
 web/react/components/sidebar_right.jsx | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

(limited to 'web/react/components/sidebar_right.jsx')

diff --git a/web/react/components/sidebar_right.jsx b/web/react/components/sidebar_right.jsx
index ac1049da0..ee247265d 100644
--- a/web/react/components/sidebar_right.jsx
+++ b/web/react/components/sidebar_right.jsx
@@ -52,14 +52,29 @@ export default class SidebarRight extends React.Component {
     doStrangeThings() {
         // We should have a better way to do this stuff
         // Hence the function name.
+        var windowWidth = $(window).outerWidth();
+        var sidebarRightWidth = $('.sidebar--right').outerWidth();
+
         $('.inner__wrap').removeClass('.move--right');
         $('.inner__wrap').addClass('move--left');
         $('.sidebar--left').removeClass('move--right');
         $('.sidebar--right').addClass('move--left');
 
         //$('.sidebar--right').prepend('<div class="sidebar__overlay"></div>');
-
-        if (!(this.state.search_visible || this.state.post_right_visible)) {
+        if (this.state.search_visible || this.state.post_right_visible) {
+            if (windowWidth > 960) {
+                $('.inner__wrap').velocity({marginRight: sidebarRightWidth}, {duration: 500, easing: 'easeOutSine'});
+                $('.sidebar--right').velocity({translateX: 0}, {duration: 500, easing: 'easeOutSine'});
+            } else {
+                $('.inner__wrap, .sidebar--right').attr('style', '');
+            }
+        } else {
+            if (windowWidth > 960) {
+                $('.inner__wrap').velocity({marginRight: 0}, {duration: 500, easing: 'easeOutSine'});
+                $('.sidebar--right').velocity({translateX: sidebarRightWidth}, {duration: 500, easing: 'easeOutSine'});
+            } else {
+                $('.inner__wrap, .sidebar--right').attr('style', '');
+            }
             $('.inner__wrap').removeClass('move--left').removeClass('move--right');
             $('.sidebar--right').removeClass('move--left');
             return (
-- 
cgit v1.2.3-1-g7c22

