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.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@95972 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Mateusz Uzdowski 2009-12-21 00:57:14 +00:00 committed by Sam Minnee
parent 451aa6c536
commit 08e9a35242

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;
}
},
/**