BUGFIX: when the JS files are combined, swfupload.js gets included in pages where there are no placeholder elements available, failing with exception and killing the javascript for the page. Now the exception is intercepted and ignored. (from r95972)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102467 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 08:45:48 +00:00
parent 8fb9fac99e
commit ea5d386c68

View File

@ -41,7 +41,14 @@ Upload.prototype = {
if(typeof params.button_width != 'undefined') this.buttonWidth = params.button_width;
if(typeof params.button_height != 'undefined') this.buttonHeight = params.button_height;
this.onLoad();
try {
this.onLoad();
} catch (ex) {
// suppress the exception in case swfupload.js is loaded in a context that has no
// placeholder elements
if ( ex.indexOf('Could not find the placeholder element')==-1 )
throw ex;
}
},
/**