ENHANCEMENT Added loading indicator for the AJAX request "Show deleted pages" checkbox in the CMS

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@76264 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-05-06 06:22:00 +00:00
parent b1b07c5325
commit 7dd4e4284c
3 changed files with 16 additions and 3 deletions

View File

@ -434,6 +434,13 @@ body.stillLoading select {
padding: 2px 1px;
float: left;
}
#checkboxActionIndicator {
float: right;
width: auto;
margin-top: 7px;
display: none;
}
div.spacer,
li.spacer {

View File

@ -141,17 +141,20 @@ ShowDeletedPagesAction.prototype = {
__makeDraggableAfterUpdate = true;
}
var indicator = $('checkboxActionIndicator');
indicator.style.display = 'block';
var request = new Ajax.Request(SiteTreeHandlers.loadTree_url + '?ID=0&ajax=1', {
onSuccess: function(response) {
$('sitetree').innerHTML = response.responseText;
SiteTree.applyTo($('sitetree'));
if(__makeDraggableAfterUpdate) $('sitetree').makeDraggable();
indicator.style.display = 'none';
},
onFailure: function(response) {
errorMessage('Could not update tree', response);
}
});
}
}

View File

@ -62,11 +62,14 @@
</div>
<div class="checkboxAboveTree">
<img id="checkboxActionIndicator" src="cms/images/network-save.gif">
<div>
<input type="checkbox" id="sortitems" /> <label for="sortitems"><% _t('ENABLEDRAGGING','Allow drag &amp; drop reordering', PR_HIGH) %></label>
<input type="checkbox" id="sortitems" />
<label for="sortitems"><% _t('ENABLEDRAGGING','Allow drag &amp; drop reordering', PR_HIGH) %></label>
</div>
<div>
<input type="checkbox" id="showdeletedpages" /> <label for="showdeletedpages"><% _t('SHOW_DELETED_PAGES','Show deleted pages', PR_HIGH) %></label>
<input type="checkbox" id="showdeletedpages" />
<label for="showdeletedpages"><% _t('SHOW_DELETED_PAGES','Show deleted pages', PR_HIGH) %></label>
</div>
</div>