Browse files

FIX 7763 TreeDropdownField needs to refresh after CMS edit form save

  • Loading branch information...
1 parent abbce15 commit 05fade32497888ca799dffa15f377a191c82f608 @hafriedlander hafriedlander committed Aug 29, 2012
Showing with 18 additions and 0 deletions.
  1. +1 −0 admin/code/LeftAndMain.php
  2. +17 −0 admin/javascript/LeftAndMain.TreeDropdownField.js
View
1 admin/code/LeftAndMain.php
@@ -289,6 +289,7 @@ function init() {
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
17 admin/javascript/LeftAndMain.TreeDropdownField.js
@@ -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);

0 comments on commit 05fade3

Please sign in to comment.