summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-02-19 20:42:29 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-02-28 15:03:26 +0100
commita9552de089b7d587ffa94b79560436a1f65c2ea8 (patch)
tree627d860f858f15afb2449d23ff65523e6714e4f9 /apps/files/js
parent0cfdf4748f248e1b55fc459a05e7782a1e585716 (diff)
downloadnextcloud-server-a9552de089b7d587ffa94b79560436a1f65c2ea8.tar.gz
nextcloud-server-a9552de089b7d587ffa94b79560436a1f65c2ea8.zip
Set the width of the parent element in breadcrumb tests
Setting the width of the parent element of the breadcrumbs and then explicitly calling "_resize" is enough to test the resizing behaviour. This makes possible to remove the "setMaxWidth" method and its related code, which was used only for testing purposes. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/breadcrumb.js20
1 files changed, 1 insertions, 19 deletions
diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js
index 20b15e3cb93..fe8e54c3a6c 100644
--- a/apps/files/js/breadcrumb.js
+++ b/apps/files/js/breadcrumb.js
@@ -239,19 +239,6 @@
},
/**
- * Show/hide breadcrumbs to fit the given width
- * Mostly used by tests
- *
- * @param {int} availableWidth available width
- */
- setMaxWidth: function (availableWidth) {
- if (this.availableWidth !== availableWidth) {
- this.availableWidth = availableWidth;
- this._resize();
- }
- },
-
- /**
* Calculate real width based on individual crumbs
* More accurate and works with tests
*
@@ -329,12 +316,7 @@
return;
}
- // Used for testing since this.$el.parent fails
- if (!this.availableWidth) {
- this.usedWidth = this.$el.parent().width() - this.$el.parent().find('.actions.creatable').width();
- } else {
- this.usedWidth = this.availableWidth;
- }
+ this.usedWidth = this.$el.parent().width() - this.$el.parent().find('.actions.creatable').width();
// If container is smaller than content
// AND if there are crumbs left to hide