Pārlūkot izejas kodu

Make ReloadSearchForm work properly when the "submit" event handler is declared either with or without a "namespace" portion (e.g. 'submit.itop' vs 'submit')

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3816 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 9 gadi atpakaļ
vecāks
revīzija
cd024c460a
1 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  1. 7 2
      js/utils.js

+ 7 - 2
js/utils.js

@@ -227,13 +227,18 @@ function ReloadSearchForm(divId, sClassName, sBaseClass, sContext)
 				for(var index = 0; index < aSubmit.length; index++)
 				{
 					// Restore the previously bound submit handlers
+					var sEventName = 'submit';
+					if (aSubmit[index].namespace != undefined)
+					{
+						sEventName += '.'+aSubmit[index].namespace;
+					}
 					if (aSubmit[index].data != undefined)
 					{
-						oForm.bind('submit.'+aSubmit[index].namespace, aSubmit[index].data, aSubmit[index].handler)
+						oForm.bind(sEventName, aSubmit[index].data, aSubmit[index].handler)
 					}
 					else
 					{
-						oForm.bind('submit.'+aSubmit[index].namespace, aSubmit[index].handler)
+						oForm.bind(sEventName, aSubmit[index].handler)
 					}
 				}
 		   }