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

"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-serv9033/var/httpd/htdocs/js

Modified Files:
	Core.Agent.Admin.ProcessManagement.js 
Log Message:
Fixed a problem in ProcessManagement popups, where closing the popup with the OS functionality ("X") caused a problem in restoring the main window, if the popup form wasn't submitted before because of a validation problem.

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.66
retrieving revision 1.67
diff -2 -u -d -r1.66 -r1.67
--- Core.Agent.Admin.ProcessManagement.js	22 Jan 2013 08:56:29 -0000	1.66
+++ Core.Agent.Admin.ProcessManagement.js	22 Jan 2013 09:46:00 -0000	1.67
@@ -41,4 +41,6 @@
 
         $('a.AsPopup_Redirect').bind('click', function (Event) {
+            var $Form = $(this).closest('form');
+
             $('#PopupRedirect').val(1);
             $('#PopupRedirectAction').val($(this).data('action'));
@@ -49,12 +51,16 @@
             if ($(this).hasClass('Edit_Confirm')) {
                 if (window.confirm(Core.Agent.Admin.ProcessManagement.Localization.EditConfirm)) {
-                    // Remove onbeforeunload event (which is only needed if you close the popup via the window "X")
-                    $(window).unbind("beforeunload.PMPopup");
+                    // Remove onbeforeunload event only if there is no validation pending on form submit
+                    if (!($Form.hasClass("Validate"))) {
+                        $(window).unbind("beforeunload.PMPopup");
+                    }
                     $(this).closest('form').submit();
                 }
             }
             else {
-                // Remove onbeforeunload event (which is only needed if you close the popup via the window "X")
-                $(window).unbind("beforeunload.PMPopup");
+                // Remove onbeforeunload event only if there is no validation pending on form submit
+                if (!($Form.hasClass("Validate"))) {
+                    $(window).unbind("beforeunload.PMPopup");
+                }
                 $(this).closest('form').submit();
             }
---------------------------------------------------------------------
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.