mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-07-07 20:09:31 +02:00
ee10dbb680
We've removed the ability to directly reference JS and CSS files for form fields and other SilverStripe features in favour of a common bundle built by Webpack. The logical next step is to make the framework module free of frontend dependencies, which should simplify its operation, and avoid another time intensive "npm install" on a module.
22 lines
524 B
JavaScript
22 lines
524 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('.grid-field');
|
|
fileList.setState('ParentID', self.getValue());
|
|
fileList.reload();
|
|
});
|
|
},
|
|
onunmatch: function() {
|
|
this._super();
|
|
}
|
|
});
|
|
});
|