mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX 7763 TreeDropdownField needs to refresh after CMS edit form save
This commit is contained in:
parent
abbce151d9
commit
05fade3249
@ -289,6 +289,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
||||
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Preview.js',
|
||||
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.BatchActions.js',
|
||||
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.FieldHelp.js',
|
||||
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.TreeDropdownField.js',
|
||||
),
|
||||
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang', true, true),
|
||||
Requirements::add_i18n_javascript(FRAMEWORK_ADMIN_DIR . '/javascript/lang', true, true)
|
||||
|
17
admin/javascript/LeftAndMain.TreeDropdownField.js
Normal file
17
admin/javascript/LeftAndMain.TreeDropdownField.js
Normal file
@ -0,0 +1,17 @@
|
||||
(function($) {
|
||||
$.entwine('ss', function($){
|
||||
|
||||
// Any TreeDowndownField needs to refresh it's contents after a form submission,
|
||||
// because the tree on the backend might have changed
|
||||
$('.TreeDropdownField').entwine({
|
||||
'from .cms-container form': {
|
||||
onaftersubmitform: function(e){
|
||||
this.find('.tree-holder').empty();
|
||||
this._super();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
Loading…
Reference in New Issue
Block a user