silverstripe-framework/javascript/src/UploadField_select.js
David Craig 2140025c20 Implement RFC-7 JavaScript module loader
- Adds ES6 support via Babel
- Transforms existing JavaScript to UMD modules
- Adds module bundling via Browserify
- Existing JavaScript converted to UMD modules
- lib.js and leftandmain.js are bundled using browserify
- JavaScript minifying of bundles handed by gulp
2016-01-26 11:39:20 +13:00

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();
}
});
});