mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT Moved sitetree filter functionality back into CMSMain->SearchForm() to simplify both serverside and clientside processing, and save precious UI real estate above the tree panel
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92725 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
898665e54b
commit
fec71a06eb
@ -4,42 +4,6 @@ SiteTreeHandlers.orderChanged_url = 'admin/ajaxupdatesort';
|
||||
SiteTreeHandlers.loadPage_url = 'admin/getitem';
|
||||
SiteTreeHandlers.loadTree_url = 'admin/getsubtree';
|
||||
|
||||
SiteTreeFilter = Class.create();
|
||||
SiteTreeFilter.applyTo('#siteTreeFilterList');
|
||||
SiteTreeFilter.prototype = {
|
||||
initialize: function () {
|
||||
},
|
||||
onchange : function() {
|
||||
var value = this.options[this.selectedIndex].value;
|
||||
|
||||
if(value != 'all') {
|
||||
$('sitetree').setCustomURL(SiteTreeHandlers.controller_url+'/getfilteredsubtree?filter='+escape(value));
|
||||
} else {
|
||||
$('sitetree').clearCustomURL();
|
||||
}
|
||||
|
||||
// We can't update the tree while it's draggable; it gets b0rked.
|
||||
var __makeDraggableAfterUpdate = false;
|
||||
if($('sitetree').isDraggable) {
|
||||
$('sitetree').stopBeingDraggable();
|
||||
__makeDraggableAfterUpdate = true;
|
||||
}
|
||||
|
||||
var indicator = $('siteTreeFilterActionIndicator');
|
||||
indicator.style.display = 'inline';
|
||||
|
||||
$('sitetree').reload({
|
||||
onSuccess: function() {
|
||||
indicator.style.display = 'none';
|
||||
if(__makeDraggableAfterUpdate) $('sitetree').makeDraggable();
|
||||
},
|
||||
onFailure: function(response) {
|
||||
errorMessage('Could not update tree', response);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tree context menu
|
||||
*/
|
||||
|
@ -31,14 +31,6 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="checkboxAboveTree" style="border-bottom:none">
|
||||
Show: <select id="siteTreeFilterList">
|
||||
<% control SiteTreeFilters %>
|
||||
<option value="$ClassName">$Title</option>
|
||||
<% end_control %>
|
||||
</select> <img id="siteTreeFilterActionIndicator" style="display:none" src="cms/images/network-save.gif">
|
||||
</div>
|
||||
|
||||
<div class="checkboxAboveTree">
|
||||
<img id="checkboxActionIndicator" src="cms/images/network-save.gif">
|
||||
|
Loading…
Reference in New Issue
Block a user