From a4aeb3f101ebf991035f824fdc1e2f3f6af045bf Mon Sep 17 00:00:00 2001 From: daeks Date: Fri, 3 May 2013 18:53:18 +0200 Subject: [PATCH] small changes --- js/sidebars.js | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/js/sidebars.js b/js/sidebars.js index 5e1bcda..fc4c1c0 100755 --- a/js/sidebars.js +++ b/js/sidebars.js @@ -65,13 +65,18 @@ if (timeout_r) { clearTimeout(timeout_r); } - var sbarWidth = $("#sb-left") + var sbarWidthL = $("#sb-left") + .width(), + sbarWidthR = $("#sb-right") .width(); + if (!codiad.sidebars.rightLock) { + sbarWidthR = 10; + } $('#editor-region') .animate({ - 'margin-left': sbarWidth + 'px', + 'margin-left': sbarWidthL + 'px', 'width': ($('body') - .outerWidth() - sbarWidth - 10) + 'px' + .outerWidth() - sbarWidthL - sbarWidthR) + 'px' }, 300, 'easeOutQuart', function(){ _this.isLeftSidebarOpen = true; $(this).trigger('h-resize-init'); @@ -82,20 +87,22 @@ 'left': '0px' }, 300, 'easeOutQuart'); }, function() { - var sbarWidth = $("#sb-left") + var sbarWidthL = $("#sb-left") + .width(), + sbarWidthR = $("#sb-right") .width(); $(this) .data("timeout_r", setTimeout($.proxy(function() { if (!codiad.sidebars.leftLock && !codiad.sidebars.modalLock) { // Check locks $(this) .animate({ - 'left': (-sbarWidth + 10) + "px" + 'left': (-sbarWidthL + 10) + "px" }, 300, 'easeOutQuart'); $('#editor-region') .animate({ 'margin-left': '10px', 'width': ($('body') - .outerWidth() - 20) + 'px' + .outerWidth() - sbarWidthR - 10) + 'px' }, 300, 'easeOutQuart', function(){ _this.isLeftSidebarOpen = false; $(this).trigger('h-resize-init'); @@ -133,13 +140,18 @@ if (timeout_r) { clearTimeout(timeout_r); } - var sbarWidth = $("#sb-right") + var sbarWidthR = $("#sb-right") + .width(), + sbarWidthL = $("#sb-left") .width(); + if (!codiad.sidebars.leftLock) { + sbarWidthL = 10; + } $('#editor-region') .animate({ - 'margin-right': sbarWidth+'px', - 'width': ($('#editor-region') - .outerWidth() - sbarWidth + 10) + 'px' + 'margin-right': sbarWidthR+'px', + 'width': ($('body') + .outerWidth() - sbarWidthL - sbarWidthR) + 'px' }, 300, 'easeOutQuart', function(){ _this.isRigthSidebarOpen = true; }); @@ -156,13 +168,18 @@ .animate({ 'right': '-190px' }, 300, 'easeOutQuart'); - var sbarWidth = $("#sb-left") + var sbarWidthL = $("#sb-left") + .width(), + sbarWidthR = $("#sb-right") .width(); + if (!codiad.sidebars.leftLock) { + sbarWidthL = 10; + } $('#editor-region') .animate({ 'margin-right': '10px', 'width': ($('body') - .outerWidth() - sbarWidth - 10) + 'px' + .outerWidth() - sbarWidthL - 10) + 'px' }, 300, 'easeOutQuart', function(){ _this.isRigthSidebarOpen = false; });