mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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);
|