Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed url concat in SiteTreURLSegmentField.js

Needed to handle existing GET params, e.g. added from
the translatable module
  • Loading branch information...
commit db47dcff4733e23d619cfa57d471063beee8ac84 1 parent ef651d9
@chillu chillu authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 javascript/SiteTreeURLSegmentField.js
View
12 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);}
);
},
Please sign in to comment.
Something went wrong with that request. Please try again.