Skip to content

Commit

Permalink
Fixed url concat in SiteTreURLSegmentField.js
Browse files Browse the repository at this point in the history
Needed to handle existing GET params, e.g. added from
the translatable module
  • Loading branch information
chillu committed Jun 29, 2012
1 parent ef651d9 commit db47dcf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions javascript/SiteTreeURLSegmentField.js
Expand Up @@ -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);}
);

},
Expand Down

0 comments on commit db47dcf

Please sign in to comment.