Avoid lonely question mark for GridField URLs in CMS

This commit is contained in:
Ingo Schommer 2012-07-13 17:33:48 +02:00
parent 78038eb75e
commit c493dc730a

View File

@ -714,7 +714,8 @@ jQuery.noConflict();
showDetailView: function(url) {
// Include any GET parameters from the current URL, as the view state might depend on it.
// For example, a list prefiltered through external search criteria might be passed to GridField.
url = $.path.addSearchParams(url, window.location.search.replace(/^\?/, ''));
var params = window.location.search.replace(/^\?/, '');
if(params) url = $.path.addSearchParams(url, params);
$('.cms-container').loadPanel(url);
}
});