svn commit: r1163093 - /ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1163093 - /ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

jleroux@apache.org
Author: jleroux
Date: Tue Aug 30 05:56:52 2011
New Revision: 1163093

URL: http://svn.apache.org/viewvc?rev=1163093&view=rev
Log:
A patch from Leon "improve the behavior of nested lookup dialogs (ajax mode) " https://issues.apache.org/jira/browse/OFBIZ-4380

Nested lookup dialogs: in one lookup dialog, it opens another lookup dialog.
trivial improvements:
1. "enter" event only occurs to lookup dialog itself
2. if mouse click out side the lookup dialog, only current activated dialog closes

Modified:
    ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=1163093&r1=1163092&r2=1163093&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Tue Aug 30 05:56:52 2011
@@ -261,7 +261,7 @@ function ConstructLookup(requestUrl, inp
             jQuery("#" + lookupId).load(requestUrlAndArgs, function(data){
                 lookupFormAction = jQuery("#" + lookupId + " form:first").attr("action");
                 modifySubmitButton(lookupId);
-                jQuery(document).bind("keypress", lookup_onKeyEnter);
+                jQuery("#" + lookupId).bind("keypress", lookup_onKeyEnter);
                 // set up the window chaining
                 // if the ACTIVATED_LOOKUP var is set there have to be more than one lookup,
                 // before registrating the new lookup we store the id of the old lookup in the
@@ -279,7 +279,7 @@ function ConstructLookup(requestUrl, inp
             });
         },
         close: function() {
-            jQuery(document).unbind("keypress", lookup_onKeyEnter);
+            jQuery("#" + lookupId).unbind("keypress", lookup_onKeyEnter);
             //when the window is closed the prev Lookup get the focus (if exists)
             if (ACTIVATED_LOOKUP) {
                 var prevLookup = GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).prevLookup;
@@ -324,7 +324,11 @@ function ConstructLookup(requestUrl, inp
     );
 
     // close the dialog when clicking outside the dialog area
-    jQuery(".ui-widget-overlay").live("click", function() {  jQuery("#" + lookupId).dialog("close"); } );
+    jQuery(".ui-widget-overlay").live("click", function() {  
+        if(!ACTIVATED_LOOKUP || lookupId==ACTIVATED_LOOKUP){
+            jQuery("#" + lookupId).dialog("close");
+        }
+    });
 
 }