mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #85 from smindel/master
FIX malformed ajax url for adding options when used in combination with translatable
This commit is contained in:
commit
22c4081e89
@ -84,6 +84,12 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
userforms.appendToURL = function(url, pathsegmenttobeadded) {
|
||||||
|
var parts = url.match(/([^\?#]*)?(\?[^#]*)?(#.*)?/);
|
||||||
|
for(var i in parts) if(!parts[i]) parts[i] = '';
|
||||||
|
return parts[1] + pathsegmenttobeadded + parts[2] + parts[3];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Workaround for not refreshing the sort.
|
* Workaround for not refreshing the sort.
|
||||||
*
|
*
|
||||||
@ -256,7 +262,7 @@
|
|||||||
|
|
||||||
// variables
|
// variables
|
||||||
var options = $(this).parent("li");
|
var options = $(this).parent("li");
|
||||||
var action = $("#Form_EditForm").attr("action") + '/field/Fields/addoptionfield';
|
var action = userforms.appendToURL($("#Form_EditForm").attr("action"), '/field/Fields/addoptionfield');
|
||||||
var parent = $(this).attr("rel");
|
var parent = $(this).attr("rel");
|
||||||
|
|
||||||
// send ajax request to the page
|
// send ajax request to the page
|
||||||
|
Loading…
Reference in New Issue
Block a user