From 2fd3fa20dffea0c601dce16a146e6bd4f73a5fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 19 Feb 2018 20:46:49 +0100 Subject: [PATCH] Replace attribute with local variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "usedWidth" attribute was not used elsewhere outside the "_resize" method, so it was replaced with a local variable. Moreover, it was also renamed to a more suitable name ("availableWidth"). Signed-off-by: Daniel Calviño Sánchez --- apps/files/js/breadcrumb.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js index fe8e54c3a6c..c02ed488da0 100644 --- a/apps/files/js/breadcrumb.js +++ b/apps/files/js/breadcrumb.js @@ -316,18 +316,18 @@ return; } - this.usedWidth = this.$el.parent().width() - this.$el.parent().find('.actions.creatable').width(); + var availableWidth = 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 - while (this.getTotalWidth() > this.usedWidth + while (this.getTotalWidth() > availableWidth && this.$el.find(this.crumbSelector).length > 0) { this._hideCrumb(); } // If container is bigger than content + element to be shown // AND if there is at least one hidden crumb while (this.$el.find('.crumb.hidden').length > 0 - && this.getTotalWidth() + this._getCrumbElement().width() < this.usedWidth) { + && this.getTotalWidth() + this._getCrumbElement().width() < availableWidth) { this._showCrumb(); }