Last active
August 5, 2018 20:51
-
-
Save m-engel/8519a5a4ace3321a56199ea97bd8734b to your computer and use it in GitHub Desktop.
MODX FilesTree Drag onlyfiles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Event: OnManagerPageBeforeRender | |
$script = "<script> | |
DirectoryTreeHandleDrop = MODx.tree.Directory.prototype._handleDrop; | |
Ext.override(MODx.tree.Directory, { | |
_handleDrop:function(e){ | |
var dropNode = e.dropNode; | |
var targetParent = e.target; | |
if(dropNode.hasChildNodes()) return false; | |
return DirectoryTreeHandleDrop(e); | |
} | |
}); | |
</script>"; | |
$controller->head['html'][] = $script; | |
return true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment