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>
This commit is contained in:
parent
23559b2eda
commit
21551d7884
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue