diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-18 17:54:21 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-18 17:59:21 +0100 |
commit | 76961ce0727d08ef3d12bd445798df221f5d2063 (patch) | |
tree | 8477a702a72f91f98341e8935a8e0d60731a4b3f /apps/files | |
parent | 59906fbb4deeed881dd1e0c590c360ad48697169 (diff) | |
download | nextcloud-server-76961ce0727d08ef3d12bd445798df221f5d2063.tar.gz nextcloud-server-76961ce0727d08ef3d12bd445798df221f5d2063.zip |
fixing javascript error where $(Files.breadcrumbs[1]).get(0) returns undefined - happens on resize to a very small width
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/js/files.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 1186a72a44f..1137364db4a 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -196,11 +196,14 @@ var Files = { if (width !== Files.lastWidth) { if ((width < Files.lastWidth || firstRun) && width < Files.breadcrumbsWidth) { if (Files.hiddenBreadcrumbs === 0) { - Files.breadcrumbsWidth -= $(Files.breadcrumbs[1]).get(0).offsetWidth; - $(Files.breadcrumbs[1]).find('a').hide(); - $(Files.breadcrumbs[1]).append('<span>...</span>'); - Files.breadcrumbsWidth += $(Files.breadcrumbs[1]).get(0).offsetWidth; - Files.hiddenBreadcrumbs = 2; + bc = $(Files.breadcrumbs[1]).get(0); + if (typeof bc != 'undefined') { + Files.breadcrumbsWidth -= bc.offsetWidth; + $(Files.breadcrumbs[1]).find('a').hide(); + $(Files.breadcrumbs[1]).append('<span>...</span>'); + Files.breadcrumbsWidth += bc.offsetWidth; + Files.hiddenBreadcrumbs = 2; + } } var i = Files.hiddenBreadcrumbs; while (width < Files.breadcrumbsWidth && i > 1 && i < Files.breadcrumbs.length - 1) { |