Skip to content
This repository
Browse code

FIX 7763 TreeDropdownField needs to refresh after CMS edit form save

  • Loading branch information...
commit 05fade32497888ca799dffa15f377a191c82f608 1 parent abbce15
Hamish Friedlander authored August 29, 2012
1  admin/code/LeftAndMain.php
@@ -289,6 +289,7 @@ function init() {
289 289
 					FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Preview.js',
290 290
 					FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.BatchActions.js',
291 291
 					FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.FieldHelp.js',
  292
+					FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.TreeDropdownField.js',
292 293
 				),
293 294
 				Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang', true, true),
294 295
 				Requirements::add_i18n_javascript(FRAMEWORK_ADMIN_DIR . '/javascript/lang', true, true)
17  admin/javascript/LeftAndMain.TreeDropdownField.js
... ...
@@ -0,0 +1,17 @@
  1
+(function($) {
  2
+	$.entwine('ss', function($){
  3
+
  4
+		// Any TreeDowndownField needs to refresh it's contents after a form submission,
  5
+		// because the tree on the backend might have changed
  6
+		$('.TreeDropdownField').entwine({
  7
+			'from .cms-container form': {
  8
+				onaftersubmitform: function(e){
  9
+					this.find('.tree-holder').empty();
  10
+					this._super();
  11
+				}
  12
+			}
  13
+		});
  14
+
  15
+	});
  16
+
  17
+})(jQuery);

0 notes on commit 05fade3

Please sign in to comment.
Something went wrong with that request. Please try again.