svn commit: r1182596 - in /ofbiz/trunk/framework/images/webapp/images: fieldlookup.js selectall.js

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

svn commit: r1182596 - in /ofbiz/trunk/framework/images/webapp/images: fieldlookup.js selectall.js

jleroux@apache.org
Author: jleroux
Date: Wed Oct 12 22:02:46 2011
New Revision: 1182596

URL: http://svn.apache.org/viewvc?rev=1182596&view=rev
Log:
Fix a small bug in the show description tootip feeding (related to autocomplete and lookup)
It was cutting the 1st part in case of composed names (like "Tiny Gizmo").

Actually this is a compromise because it's impossible to correctly handle all cases w/out a deep (maybe impossible) refactoring on searchFields in Lookups screens definition.
So now for few lookups, tooltips descriptions will possibly contain more/redundant information than before (like "admin THE ADMINISTRATOR" in Order Creation, instead of only "THE ADMINISTRATOR" before) but by and large the behaviour will be better (ie descriptions will contain more complete information). This is obvious for products lookups for instance, but not only....

I have tried to generalize using the same logic in lookupDescriptionLoaded (in adding a showDescription parameter), but gave up as it was making things more blurred than before

I don't backport: more an improvement than a real bug

Modified:
    ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
    ofbiz/trunk/framework/images/webapp/images/selectall.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=1182596&r1=1182595&r2=1182596&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Wed Oct 12 22:02:46 2011
@@ -678,7 +678,7 @@ function set_values (value, value2) {
     var target2 = obj_caller.target2;
     write_value(value, target);
     write_value(value2, target2)
-    if (SHOW_DESCRIPTION) setLookDescription(target.attr("id"), value + " " + value2, "", "");
+    if (SHOW_DESCRIPTION) setLookDescription(target.attr("id"), value + " " + value2, "", "", SHOW_DESCRIPTION);
     
     closeLookup();
 }

Modified: ofbiz/trunk/framework/images/webapp/images/selectall.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/selectall.js?rev=1182596&r1=1182595&r2=1182596&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/selectall.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/selectall.js Wed Oct 12 22:02:46 2011
@@ -430,7 +430,7 @@ function ajaxAutoCompleter(areaCsvString
                 jQuery("#" + areaArray[0]).val(ui.item.value); // setting a text field  
                 jQuery("#" + areaArray[0]).trigger("lookup:changed"); // notify the field has changed
                 if (showDescription) {
-                    setLookDescription(areaArray[0], ui.item.label, areaArray[2], formName)
+                    setLookDescription(areaArray[0], ui.item.label, areaArray[2], formName, showDescription)
                 }
             }
         });
@@ -444,7 +444,7 @@ function ajaxAutoCompleter(areaCsvString
     }
 }
 
-function setLookDescription(textFieldId, description, params, formName){
+function setLookDescription(textFieldId, description, params, formName, showDescription){
     if (description) {
         var start = description.lastIndexOf(' [');
         if (start != -1) {
@@ -461,7 +461,7 @@ function setLookDescription(textFieldId,
         }
         var lookupWrapperEl = jQuery("#" + textFieldId).closest('.field-lookup');
         if (lookupWrapperEl.length) {
-            if (start == -1) {
+            if (start == -1 && showDescription) {
                 var start = description.indexOf(' ');
                 if (start != -1 && description.indexOf('<script type="text/javascript">') == -1) {
                     description = description.substring(start);