Browse Source

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

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3482 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 10 năm trước cách đây
mục cha
commit
feab59ea52
1 tập tin đã thay đổi với 9 bổ sung2 xóa
  1. 9 2
      js/property_field.js

+ 9 - 2
js/property_field.js

@@ -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
+						}
 					}
 				}
 			});