Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FIX 7763 TreeDropdownField needs to refresh after CMS edit form save

  • Loading branch information...
commit 05fade32497888ca799dffa15f377a191c82f608 1 parent abbce15
Hamish Friedlander hafriedlander authored
1  admin/code/LeftAndMain.php
View
@@ -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)
17 admin/javascript/LeftAndMain.TreeDropdownField.js
View
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.