summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-02-28 14:35:28 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-02-28 15:03:26 +0100
commit292476911fdf77a7cb8d0d1202ed05a38c5ced3b (patch)
tree6301405ddbfbd892053a8830ad25e89d9d5f0404
parentd122d054d368f8b7084f3ff31c406867b6c0a55c (diff)
downloadnextcloud-server-292476911fdf77a7cb8d0d1202ed05a38c5ced3b.tar.gz
nextcloud-server-292476911fdf77a7cb8d0d1202ed05a38c5ced3b.zip
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>
-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]);