silverstripe-framework/javascript/UploadField_select.js
2013-05-26 11:11:55 +12:00

22 lines
546 B
JavaScript

(function($) {
$.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();
}
});
});
})(jQuery);