diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-02-19 20:42:29 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-02-28 15:03:26 +0100 |
commit | a9552de089b7d587ffa94b79560436a1f65c2ea8 (patch) | |
tree | 627d860f858f15afb2449d23ff65523e6714e4f9 /apps/files/js | |
parent | 0cfdf4748f248e1b55fc459a05e7782a1e585716 (diff) | |
download | nextcloud-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.js | 20 |
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 |