BUGFIX Checking for existence of $('SwitchView') (fixes #5282) (from r108436)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@108828 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-08-03 03:36:44 +00:00
parent 2143443472
commit 69ca614fa4

View File

@ -392,9 +392,10 @@ var ss_MainLayout;
$('#Form_EditForm').bind('load delete', function(e) {
var updatedSwitchView = $('#AjaxSwitchView');
console.debug(updatedSwitchView.html());
$('#SwitchView').html(updatedSwitchView.html());
updatedSwitchView.remove();
if(updatedSwitchView.length) {
$('#SwitchView').html(updatedSwitchView.html());
updatedSwitchView.remove();
}
});
}
});