mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR Disabled AssetAdmin form reload after uploading through iframe, relies on old tree.js library - UI will change anyway
This commit is contained in:
parent
3b01a9af67
commit
91995ad73b
@ -281,13 +281,14 @@ JS
|
||||
$sFileIDs = implode(',', $fileIDs);
|
||||
$sFileNames = implode(',', $fileNames);
|
||||
|
||||
echo <<<HTML
|
||||
<script type="text/javascript">
|
||||
var url = parent.document.getElementById('sitetree').getTreeNodeByIdx( "{$folder->ID}" ).getElementsByTagName('a')[0].href;
|
||||
parent.jQuery('#Form_EditForm').entwine('ss').loadForm(url);
|
||||
parent.statusMessage("{$statusMessage}","{$status}");
|
||||
</script>
|
||||
HTML;
|
||||
// TODO Will be replaced by new upload mechanism, refresh disabled for now
|
||||
// echo <<<HTML
|
||||
// <script type="text/javascript">
|
||||
// var url = parent.document.getElementById('sitetree').getTreeNodeByIdx( "{$folder->ID}" ).getElementsByTagName('a')[0].href;
|
||||
// parent.jQuery('#Form_EditForm').entwine('ss').loadForm(url);
|
||||
// parent.statusMessage("{$statusMessage}","{$status}");
|
||||
// </script>
|
||||
// HTML;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,7 +99,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
HtmlEditorConfig::get('cms')->setOption('spellchecker_languages', "+{$langName}={$this->Locale}");
|
||||
|
||||
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.js');
|
||||
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.Tree.js');
|
||||
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.EditForm.js');
|
||||
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.Translatable.js');
|
||||
|
||||
|
@ -1,37 +0,0 @@
|
||||
/**
|
||||
* File: CMSMain.Tree.js
|
||||
*/
|
||||
if(typeof SiteTreeHandlers == 'undefined') SiteTreeHandlers = {};
|
||||
SiteTreeHandlers.parentChanged_url = 'admin/ajaxupdateparent';
|
||||
SiteTreeHandlers.orderChanged_url = 'admin/ajaxupdatesort';
|
||||
SiteTreeHandlers.loadPage_url = 'admin/getitem';
|
||||
SiteTreeHandlers.loadTree_url = 'admin/getsubtree';
|
||||
|
||||
TreeContextMenu = {
|
||||
'Edit this page' : function(treeNode) {
|
||||
treeNode.selectTreeNode();
|
||||
},
|
||||
'Duplicate page and children' : function(treeNode) {
|
||||
// First save the page silently (without confirmation) and then duplicate the page.
|
||||
jQuery('#Form_EditForm').entwine('ss').ajaxSubmit(null, treeNode.duplicatePageWithChildren.bind(treeNode));
|
||||
},
|
||||
'Duplicate just this page' : function(treeNode) {
|
||||
// First save the page silently (without confirmation) and then duplicate the page.
|
||||
jQuery('#Form_EditForm').entwine('ss').ajaxSubmit(null, treeNode.duplicatePageWithChildren.bind(treeNode));
|
||||
},
|
||||
'Sort sub-pages' : function(treeNode) {
|
||||
var children = treeNode.treeNodeHolder().childTreeNodes();
|
||||
var sortedChildren = children.sort(function(a, b) {
|
||||
var titleA = a.aTag.innerHTML.replace(/<[^>]*>/g,'');
|
||||
var titleB = b.aTag.innerHTML.replace(/<[^>]*>/g,'');
|
||||
return titleA < titleB ? -1 : (titleA > titleB ? 1 : 0);
|
||||
});
|
||||
|
||||
var i,child;
|
||||
for(i=0;child=sortedChildren[i];i++) {
|
||||
treeNode.appendTreeNode(child);
|
||||
}
|
||||
|
||||
treeNode.onOrderChanged(sortedChildren,treeNode);
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user