mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-08 10:41:25 +02:00
http://open.silverstripe.org/ticket/7046 UploadField would default to one folder only, and wouldn't allow asset tree traversal. HtmlEditorField MediaForm has this capability, so added it here in a similar fashion via TreeDropdownField.
19 lines
504 B
JavaScript
19 lines
504 B
JavaScript
(function($) {
|
|
$.entwine('ss', function($) {
|
|
// Install the directory selection handler
|
|
$('form.uploadfield-form #ParentID .TreeDropdownField').entwine({
|
|
onmatch: function() {
|
|
this._super();
|
|
|
|
var self = this;
|
|
this.bind('change', function() {
|
|
// Display the contents of the folder in the listing field.
|
|
var fileList = self.closest('form').find('.ss-gridfield');
|
|
fileList.setState('ParentID', self.getValue());
|
|
fileList.reload();
|
|
});
|
|
}
|
|
});
|
|
});
|
|
})(jQuery);
|