diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-08-28 13:55:47 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-08-28 13:55:47 +0200 |
commit | 59cf326831fdd255c284a52d20b73d49ee287216 (patch) | |
tree | 29892f27cb48b9746db843df8fcde9175358ac24 /core | |
parent | e9e8f576554504784870c70e4a750fe3df7fbeb4 (diff) | |
parent | 7303b68577979bfe53859157f60659bfb3c6000e (diff) | |
download | nextcloud-server-59cf326831fdd255c284a52d20b73d49ee287216.tar.gz nextcloud-server-59cf326831fdd255c284a52d20b73d49ee287216.zip |
Merge pull request #18623 from owncloud/controls-resize-sidebar-visibility
Fix controls bar calculation
Diffstat (limited to 'core')
-rw-r--r-- | core/js/apps.js | 6 | ||||
-rw-r--r-- | core/js/js.js | 12 |
2 files changed, 12 insertions, 6 deletions
diff --git a/core/js/apps.js b/core/js/apps.js index f148de3b2e9..d8f4bfdf1c5 100644 --- a/core/js/apps.js +++ b/core/js/apps.js @@ -27,8 +27,8 @@ */ exports.Apps.showAppSidebar = function($el) { var $appSidebar = $el || $('#app-sidebar'); - $appSidebar.removeClass('disappear') - $('#app-content').addClass('with-app-sidebar'); + $appSidebar.removeClass('disappear'); + $('#app-content').addClass('with-app-sidebar').trigger(new $.Event('appresized')); }; @@ -41,7 +41,7 @@ exports.Apps.hideAppSidebar = function($el) { var $appSidebar = $el || $('#app-sidebar'); $appSidebar.addClass('disappear'); - $('#app-content').removeClass('with-app-sidebar'); + $('#app-content').removeClass('with-app-sidebar').trigger(new $.Event('appresized')); }; /** 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); } |