FIX 7763 TreeDropdownField needs to refresh after CMS edit form save

This commit is contained in:
Hamish Friedlander 2012-08-29 10:52:56 +12:00
parent abbce151d9
commit 05fade3249
2 changed files with 18 additions and 0 deletions

View File

@ -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)

View 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);