aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/breadcrumb.js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-02-20 00:11:40 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-02-28 15:03:26 +0100
commita37007f872df68dec9038cf43846f8bd998ff19b (patch)
tree91626372410b9e7ce0a508a1e9f83ea02cc512df /apps/files/js/breadcrumb.js
parente37c4fd7f308be6f4dbece2c6cd2e8ff2d211c09 (diff)
downloadnextcloud-server-a37007f872df68dec9038cf43846f8bd998ff19b.tar.gz
nextcloud-server-a37007f872df68dec9038cf43846f8bd998ff19b.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/breadcrumb.js')
-rw-r--r--apps/files/js/breadcrumb.js10
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