diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-02-28 16:35:28 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-03-01 22:33:14 +0300 |
commit | 21551d7884a77bf8652c0f295f1c8fd975a2da79 (patch) | |
tree | a91ec79376f177e0064ca0541a8545d773b7e9dc /apps | |
parent | 23559b2eda31d1ec720352e999779b9883c8de13 (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')
-rw-r--r-- | apps/files/js/breadcrumb.js | 5 |
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]); |