silverstripe-framework/admin/client/src/legacy/UploadField_select.js

22 lines
524 B
JavaScript
Raw Normal View History

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.
2016-07-01 03:37:29 +02:00
var fileList = self.closest('form').find('.grid-field');
fileList.setState('ParentID', self.getValue());
fileList.reload();
});
},
onunmatch: function() {
this._super();
}
});
});