]> source.dussan.org Git - nextcloud-server.git/commitdiff
check if element really exists before calling it. (e.g. for public shared files view...
authorBjörn Schießle <schiessle@owncloud.com>
Thu, 4 Oct 2012 12:31:06 +0000 (14:31 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Fri, 5 Oct 2012 08:32:38 +0000 (10:32 +0200)
apps/files/js/files.js

index 0c00fe8c922ed8e1e108c142c7dcecb052d785cf..414dfb03cdccaecf4eb6535b620ffb5a604b3255 100644 (file)
@@ -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) {