浏览代码

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 年之前
父节点
当前提交
feab59ea52
共有 1 个文件被更改,包括 9 次插入2 次删除
  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
+						}
 					}
 				}
 			});