[otrs-cvs] otrs/var/httpd/htdocs/js Core.Agent.Admin.ProcessManagement.js, 1.69, 1.70

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/var/httpd/htdocs/js
In directory lancelot:/tmp/cvs-serv9203/var/httpd/htdocs/js

Modified Files:
	Core.Agent.Admin.ProcessManagement.js 
Log Message:
Fixed a problem, that when deleting the last key/value pair in a transition action, you couldn't add new ones. Also changed the type of buttons to not send form automatically on pressing enter.

Author: mn

Index: Core.Agent.Admin.ProcessManagement.js
===================================================================
RCS file: /home/cvs/otrs/var/httpd/htdocs/js/Core.Agent.Admin.ProcessManagement.js,v
retrieving revision 1.69
retrieving revision 1.70
diff -2 -u -d -r1.69 -r1.70
--- Core.Agent.Admin.ProcessManagement.js	23 Jan 2013 15:44:26 -0000	1.69
+++ Core.Agent.Admin.ProcessManagement.js	28 Jan 2013 10:25:10 -0000	1.70
@@ -1047,7 +1047,17 @@
             // therefore, we search the preceding fieldset and the first
             // label in it to get its "for"-attribute which contains the index
-            var LastKnownFieldIndex = parseInt($(this).prev('fieldset').find('label').attr('for').replace(/ConfigKey\[/, '').replace(/\]/, ''), 10),
-                // get current index
-                ConfigParamHTML = $('#ConfigParamContainer').html().replace(/_INDEX_/g, LastKnownFieldIndex + 1);
+            var $PreviousField = $(this).prev('fieldset'),
+                LastKnownFieldIndex,
+                ConfigParamHTML;
+
+            if ($PreviousField.length) {
+                LastKnownFieldIndex = parseInt($PreviousField.find('label').attr('for').replace(/ConfigKey\[/, '').replace(/\]/, ''), 10);
+            }
+            else {
+                LastKnownFieldIndex = 0;
+            }
+
+            // get current index
+            ConfigParamHTML = $('#ConfigParamContainer').html().replace(/_INDEX_/g, LastKnownFieldIndex + 1);
 
             $(ConfigParamHTML).insertBefore($('#ConfigAdd'));
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.