Protect against JS errors when the form is in read-only mode.

SVN:trunk[3482]
This commit is contained in:
Denis Flaven
2014-12-23 14:49:06 +00:00
parent f594190005
commit af3c93051f

View File

@@ -344,8 +344,15 @@ $(function()
var oWidget = me._get_widget($(this).closest('.itop-property-field'));
if (oWidget)
{
oWidget._setOptions({can_apply: !me.bModified, parent_selector: '#'+me.element.attr('id') });
oWidget.validate();
try
{
oWidget._setOptions({can_apply: !me.bModified, parent_selector: '#'+me.element.attr('id') });
oWidget.validate();
}
catch(e)
{
// Do nothing, form in read-only mode
}
}
}
});