check if element really exists before calling it. (e.g. for public shared files view, elements like "navigation" doesn't exist)

This commit is contained in:
Björn Schießle 2012-10-04 14:31:06 +02:00
parent f493e97f5d
commit 5beca59b9c
1 changed files with 8 additions and 2 deletions

View 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,6 +410,7 @@ $(document).ready(function() {
}
})
});
}
$.assocArraySize = function(obj) {
// http://stackoverflow.com/a/6700/11236
@ -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) {