diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-02-20 00:11:40 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-03-01 20:33:14 +0100 |
commit | a93dac6a9c9cf722aa77e8d0ca38afa4518e1731 (patch) | |
tree | ccf6d88bb33c4d4bffeaf310105f74ab108893df /apps/files/js | |
parent | bb85084c3de5e7563ad0131c5206a9c61f57a3ee (diff) | |
download | nextcloud-server-a93dac6a9c9cf722aa77e8d0ca38afa4518e1731.tar.gz nextcloud-server-a93dac6a9c9cf722aa77e8d0ca38afa4518e1731.zip |
Take all visible siblings into account
Other apps could add elements to the controls outside the creatable
actions div (for example, the button to switch to the gallery), so the
widths of all the visible siblings of the breadcrumbs have to be taken
into account in the size calculations.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/breadcrumb.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js index 16762f386be..4a61188e93a 100644 --- a/apps/files/js/breadcrumb.js +++ b/apps/files/js/breadcrumb.js @@ -316,7 +316,15 @@ return; } - var availableWidth = this.$el.parent().width() - this.$el.parent().find('.actions.creatable').outerWidth(true); + var siblingsWidth = 0; + this.$el.prevAll(':visible').each(function () { + siblingsWidth += $(this).outerWidth(true); + }); + this.$el.nextAll(':visible').each(function () { + siblingsWidth += $(this).outerWidth(true); + }); + + var availableWidth = this.$el.parent().width() - siblingsWidth; // If container is smaller than content // AND if there are crumbs left to hide |