diff options
author | Björn Schießle <schiessle@owncloud.com> | 2012-10-04 14:31:06 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2012-10-05 10:32:38 +0200 |
commit | 5beca59b9c277d479b899e59920acb57a5d81983 (patch) | |
tree | 337a36ca4f49fd0d1b057b7d05dd1fc166f2e429 /apps | |
parent | f493e97f5dc46b4ec7f73dbfc3bd42537ff0761c (diff) | |
download | nextcloud-server-5beca59b9c277d479b899e59920acb57a5d81983.tar.gz nextcloud-server-5beca59b9c277d479b899e59920acb57a5d81983.zip |
check if element really exists before calling it. (e.g. for public shared files view, elements like "navigation" doesn't exist)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/files.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 0c00fe8c922..414dfb03cdc 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -195,6 +195,8 @@ $(document).ready(function() { e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone }); + if ( document.getElementById("file_upload_start") ) { + $(function() { $('.file_upload_start').fileupload({ dropZone: $('#content'), // restrict dropZone to content div @@ -408,7 +410,8 @@ $(document).ready(function() { } }) }); - + } + $.assocArraySize = function(obj) { // http://stackoverflow.com/a/6700/11236 var size = 0, key; @@ -592,7 +595,10 @@ $(document).ready(function() { var lastWidth = 0; var breadcrumbs = []; - var breadcrumbsWidth = $('#navigation').get(0).offsetWidth; + var breadcrumbsWidth = 0; + if ( document.getElementById("navigation") ) { + breadcrumbsWidth = $('#navigation').get(0).offsetWidth; + } var hiddenBreadcrumbs = 0; $.each($('.crumb'), function(index, breadcrumb) { |