fixing javascript error where $(Files.breadcrumbs[1]).get(0) returns undefined - happens on resize to a very small width
This commit is contained in:
parent
59906fbb4d
commit
76961ce072
|
@ -196,12 +196,15 @@ var Files = {
|
||||||
if (width !== Files.lastWidth) {
|
if (width !== Files.lastWidth) {
|
||||||
if ((width < Files.lastWidth || firstRun) && width < Files.breadcrumbsWidth) {
|
if ((width < Files.lastWidth || firstRun) && width < Files.breadcrumbsWidth) {
|
||||||
if (Files.hiddenBreadcrumbs === 0) {
|
if (Files.hiddenBreadcrumbs === 0) {
|
||||||
Files.breadcrumbsWidth -= $(Files.breadcrumbs[1]).get(0).offsetWidth;
|
bc = $(Files.breadcrumbs[1]).get(0);
|
||||||
|
if (typeof bc != 'undefined') {
|
||||||
|
Files.breadcrumbsWidth -= bc.offsetWidth;
|
||||||
$(Files.breadcrumbs[1]).find('a').hide();
|
$(Files.breadcrumbs[1]).find('a').hide();
|
||||||
$(Files.breadcrumbs[1]).append('<span>...</span>');
|
$(Files.breadcrumbs[1]).append('<span>...</span>');
|
||||||
Files.breadcrumbsWidth += $(Files.breadcrumbs[1]).get(0).offsetWidth;
|
Files.breadcrumbsWidth += bc.offsetWidth;
|
||||||
Files.hiddenBreadcrumbs = 2;
|
Files.hiddenBreadcrumbs = 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
var i = Files.hiddenBreadcrumbs;
|
var i = Files.hiddenBreadcrumbs;
|
||||||
while (width < Files.breadcrumbsWidth && i > 1 && i < Files.breadcrumbs.length - 1) {
|
while (width < Files.breadcrumbsWidth && i > 1 && i < Files.breadcrumbs.length - 1) {
|
||||||
Files.breadcrumbsWidth -= $(Files.breadcrumbs[i]).get(0).offsetWidth;
|
Files.breadcrumbsWidth -= $(Files.breadcrumbs[i]).get(0).offsetWidth;
|
||||||
|
|
Loading…
Reference in New Issue