X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=js%2Fkivi.CustomerVendor.js;h=1cb08db499ad8cbea8d9d3aac0c82e7f0d979bbe;hb=7c7d5fbe259ce70e8f8965180c9918343bb9ce4b;hp=bfef730d4f793a01912005e8bfa525e48a64a439;hpb=53d80f2a01439ee73cf679c53326ec8fb32ab1ed;p=kivitendo-erp.git diff --git a/js/kivi.CustomerVendor.js b/js/kivi.CustomerVendor.js index bfef730d4..1cb08db49 100644 --- a/js/kivi.CustomerVendor.js +++ b/js/kivi.CustomerVendor.js @@ -77,7 +77,7 @@ namespace('kivi.CustomerVendor', function(ns) { '#country' ]; - this.MapWidget = function(prefix) + this.MapWidget = function(prefix, source_address) { var $mapSearchElements = []; var $widgetWrapper; @@ -117,7 +117,9 @@ namespace('kivi.CustomerVendor', function(ns) { searchString += stmt; } - var url = 'https://maps.google.com/maps?q='+ encodeURIComponent(searchString); + source_address = source_address || ''; + var query = source_address != '' ? 'saddr=' + encodeURIComponent(source_address) + '&daddr=' : 'q='; + var url = 'https://maps.google.com/maps?' + query + encodeURIComponent(searchString); window.open(url, '_blank'); window.focus();