mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR: Make return trigger search, not clear, on SiteTree Filter
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@76943 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
6bdb807af1
commit
ddbf2e2e99
@ -195,7 +195,16 @@ SiteTreeFilterForm.prototype = {
|
|||||||
onsubmit: function() {
|
onsubmit: function() {
|
||||||
var filters = $H();
|
var filters = $H();
|
||||||
|
|
||||||
if (this.clicked == 'Search') {
|
if (this.clicked == 'Clear') {
|
||||||
|
Form.getElements(this).each(function(el){
|
||||||
|
if (el.type == 'text') el.value = '';
|
||||||
|
else if (el.type == 'select-one') el.value = 'All';
|
||||||
|
});
|
||||||
|
document.getElementsBySelector('.SearchCriteriaContainer', this).each(function(el){
|
||||||
|
Element.hide(el);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else {
|
||||||
Form.getElements(this).each(function(el){
|
Form.getElements(this).each(function(el){
|
||||||
if (el.type == 'text') {
|
if (el.type == 'text') {
|
||||||
if ($F(el)) filters[el.name] = $F(el);
|
if ($F(el)) filters[el.name] = $F(el);
|
||||||
@ -205,15 +214,6 @@ SiteTreeFilterForm.prototype = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
Form.getElements(this).each(function(el){
|
|
||||||
if (el.type == 'text') el.value = '';
|
|
||||||
else if (el.type == 'select-one') el.value = 'All';
|
|
||||||
});
|
|
||||||
document.getElementsBySelector('.SearchCriteriaContainer', this).each(function(el){
|
|
||||||
Element.hide(el);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filters.keys().length) {
|
if (filters.keys().length) {
|
||||||
// Set new URL
|
// Set new URL
|
||||||
|
Loading…
Reference in New Issue
Block a user