From e8e8ff22ae3f1e52411a4a10f2ab5a4cd9a16bdc Mon Sep 17 00:00:00 2001 From: daeks Date: Thu, 2 May 2013 17:51:08 +0200 Subject: [PATCH] resize editor on rightbar change --- js/sidebars.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/sidebars.js b/js/sidebars.js index 8838b36..5e1bcda 100755 --- a/js/sidebars.js +++ b/js/sidebars.js @@ -133,9 +133,13 @@ if (timeout_r) { clearTimeout(timeout_r); } + var sbarWidth = $("#sb-right") + .width(); $('#editor-region') .animate({ - 'margin-right': '200px' + 'margin-right': sbarWidth+'px', + 'width': ($('#editor-region') + .outerWidth() - sbarWidth + 10) + 'px' }, 300, 'easeOutQuart', function(){ _this.isRigthSidebarOpen = true; }); @@ -152,9 +156,13 @@ .animate({ 'right': '-190px' }, 300, 'easeOutQuart'); + var sbarWidth = $("#sb-left") + .width(); $('#editor-region') .animate({ - 'margin-right': '10px' + 'margin-right': '10px', + 'width': ($('body') + .outerWidth() - sbarWidth - 10) + 'px' }, 300, 'easeOutQuart', function(){ _this.isRigthSidebarOpen = false; });