mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-13 13:06:32 +02:00
22 lines
528 B
JavaScript
22 lines
528 B
JavaScript
|
import $ from './jQuery';
|
||
|
|
||
|
$.entwine('ss', function($) {
|
||
|
// Install the directory selection handler
|
||
|
$('form.uploadfield-form .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();
|
||
|
});
|
||
|
},
|
||
|
onunmatch: function() {
|
||
|
this._super();
|
||
|
}
|
||
|
});
|
||
|
});
|