From 17db70f01acaced10c7627367c2edf0aa11fdfc9 Mon Sep 17 00:00:00 2001 From: Sascha Rodekamp Date: Mon, 9 Jul 2012 09:13:54 +0000 Subject: [PATCH] fixed a js bug in the lookups - worng link parsing if there's a slash '/' in the data git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1358988 13f79535-47bb-0310-9956-ffa450edef68 --- framework/images/webapp/images/fieldlookup.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/images/webapp/images/fieldlookup.js b/framework/images/webapp/images/fieldlookup.js index ce21bcf08a..8459aa9a92 100644 --- a/framework/images/webapp/images/fieldlookup.js +++ b/framework/images/webapp/images/fieldlookup.js @@ -449,7 +449,7 @@ var FieldLookupCounter = function() { }; }; -var GLOBAL_LOOKUP_REF = new FieldLookupCounter; +var GLOBAL_LOOKUP_REF = new FieldLookupCounter(); /******************************************************************************* * Button Modifier Object @@ -474,8 +474,8 @@ var ButtonModifier = function(lookupDiv) { var slTitleBars = jQuery("#" + lookupDiv + " .screenlet-title-bar"); - jQuery.each(slTitleBars, function(i) { - var slTitleBar = slTitleBars[i]; + jQuery.each(slTitleBars, function(index) { + var slTitleBar = slTitleBars[index]; var ul = slTitleBar.firstChild; if ((typeof ul) != 'object') { return true; @@ -610,10 +610,10 @@ var ButtonModifier = function(lookupDiv) { jQuery.each(cellChilds, function(child) { if (cellChilds[child].tagName == "A") { var link = cellChilds[child].href; - var liSub = link.substring(link.lastIndexOf('/') + 1, (link.length)); - if (liSub.indexOf("javascript:set_") != -1) { + if (link.indexOf("javascript:set_") != -1) { cellChilds[child].href = link; } else { + var liSub = link.substring(link.lastIndexOf('/') + 1, (link.length)); cellChilds[child].href = "javascript:lookupAjaxRequest('" + liSub + "&presentation=layer')"; } }