From db47dcff4733e23d619cfa57d471063beee8ac84 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 29 Jun 2012 14:21:44 +0200 Subject: [PATCH] Fixed url concat in SiteTreURLSegmentField.js Needed to handle existing GET params, e.g. added from the translatable module --- javascript/SiteTreeURLSegmentField.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/javascript/SiteTreeURLSegmentField.js b/javascript/SiteTreeURLSegmentField.js index 086e4e7b..83365a00 100644 --- a/javascript/SiteTreeURLSegmentField.js +++ b/javascript/SiteTreeURLSegmentField.js @@ -127,13 +127,13 @@ * (Function) callback */ suggest: function(val, callback) { - var field = this.find(':text'); + var field = this.find(':text'), urlParts = $.path.parseUrl(this.closest('form').attr('action')), + url = urlParts.hrefNoSearch + '/field/' + field.attr('name') + '/suggest/?value=' + encodeURIComponent(val); + if(urlParts.search) url += '&' + urlParts.search.replace(/^\?/, ''); + $.get( - this.closest('form').attr('action') + - '/field/' + field.attr('name') + '/suggest/?value=' + encodeURIComponent(val), - function(data) { - callback.apply(this, arguments); - } + url, + function(data) {callback.apply(this, arguments);} ); },