diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-08-28 12:23:57 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-08-28 12:23:57 +0200 |
commit | 7303b68577979bfe53859157f60659bfb3c6000e (patch) | |
tree | ea7665217d90cb05528cb85ed1e159524aa401ed /core/js/js.js | |
parent | d3fc28a6ba7f7a5a10e9567ddb757c8794ffcaa5 (diff) | |
download | nextcloud-server-7303b68577979bfe53859157f60659bfb3c6000e.tar.gz nextcloud-server-7303b68577979bfe53859157f60659bfb3c6000e.zip |
Fix controls bar calculation
Controls bar calculation needs to take the sidebar visibility into
account.
Recalculation is now triggered when sidebar is toggled, using a new
app-content event "appresized".
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/js/js.js b/core/js/js.js index 52cf076472a..8d3756ae2ec 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1393,13 +1393,19 @@ function initCore() { // if there is a scrollbar … if($('#app-content').get(0).scrollHeight > $('#app-content').height()) { if($(window).width() > 768) { - controlsWidth = $('#content').width() - $('#app-navigation').width() - $('#app-sidebar').width() - getScrollBarWidth(); + controlsWidth = $('#content').width() - $('#app-navigation').width() - getScrollBarWidth(); + if (!$('#app-sidebar').hasClass('hidden') && !$('#app-sidebar').hasClass('disappear')) { + controlsWidth -= $('#app-sidebar').width(); + } } else { controlsWidth = $('#content').width() - getScrollBarWidth(); } } else { // if there is none if($(window).width() > 768) { - controlsWidth = $('#content').width() - $('#app-navigation').width() - $('#app-sidebar').width(); + controlsWidth = $('#content').width() - $('#app-navigation').width(); + if (!$('#app-sidebar').hasClass('hidden') && !$('#app-sidebar').hasClass('disappear')) { + controlsWidth -= $('#app-sidebar').width(); + } } else { controlsWidth = $('#content').width(); } @@ -1411,7 +1417,7 @@ function initCore() { $(window).resize(_.debounce(adjustControlsWidth, 250)); - $('body').delegate('#app-content', 'apprendered', adjustControlsWidth); + $('body').delegate('#app-content', 'apprendered appresized', adjustControlsWidth); } |