Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-02-28 16:35:28 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-02-28 17:03:26 +0300
commit292476911fdf77a7cb8d0d1202ed05a38c5ced3b (patch)
tree6301405ddbfbd892053a8830ad25e89d9d5f0404 /apps/files/js/breadcrumb.js
parentd122d054d368f8b7084f3ff31c406867b6c0a55c (diff)
Improve documentation of "getTotalWidth"
"getTotalWidth" is not more accurate; it is simply not clamped. Moreover, "width/outerWidth" could be used in tests too, and also even if "getTotalWidth" could be used in tests while others not that would not be something to be stated in the API documentation, but in a comment. 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.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js
index b9e8e6920e9..2593e12d72f 100644
--- a/apps/files/js/breadcrumb.js
+++ b/apps/files/js/breadcrumb.js
@@ -241,11 +241,14 @@
/**
* Calculate real width based on individual crumbs
- * More accurate and works with tests
*
* @param {boolean} ignoreHidden ignore hidden crumbs
*/
getTotalWidth: function(ignoreHidden) {
+ // The width has to be calculated by adding up the width of all the
+ // crumbs; getting the width of the breadcrumb element is not a
+ // valid approach, as the returned value could be clamped to its
+ // parent width.
var totalWidth = 0;
for (var i = 0; i < this.breadcrumbs.length; i++ ) {
var $crumb = $(this.breadcrumbs[i]);