Skip to content

Commit

Permalink
ENHANCEMENT Moved sitetree filter functionality back into CMSMain->Se…
Browse files Browse the repository at this point in the history
…archForm() 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
  • Loading branch information
chillu committed Nov 21, 2009
1 parent 898665e commit fec71a0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
36 changes: 0 additions & 36 deletions javascript/CMSMain_left.js
Expand Up @@ -4,42 +4,6 @@ SiteTreeHandlers.orderChanged_url = 'admin/ajaxupdatesort';
SiteTreeHandlers.loadPage_url = 'admin/getitem'; SiteTreeHandlers.loadPage_url = 'admin/getitem';
SiteTreeHandlers.loadTree_url = 'admin/getsubtree'; 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 * Tree context menu
*/ */
Expand Down
8 changes: 0 additions & 8 deletions templates/Includes/CMSMain_TreeTools.ss
Expand Up @@ -31,14 +31,6 @@
</div> </div>


</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"> <div class="checkboxAboveTree">
<img id="checkboxActionIndicator" src="cms/images/network-save.gif"> <img id="checkboxActionIndicator" src="cms/images/network-save.gif">
Expand Down

0 comments on commit fec71a0

Please sign in to comment.