From 5f635d831587b9e1209cb4acdac30fd19c5272d1 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 22 Feb 2012 17:27:02 +0100 Subject: [PATCH] BUGFIX Don't reload TreeDropdownField title via ajax if no value is set (which causes infinite loops) --- javascript/TreeDropdownField.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/TreeDropdownField.js b/javascript/TreeDropdownField.js index 3c298d1e4..132ef112b 100644 --- a/javascript/TreeDropdownField.js +++ b/javascript/TreeDropdownField.js @@ -118,7 +118,7 @@ * Update title from tree node value */ updateTitle: function() { - var self = this, tree = self.find('.tree-holder'); + var self = this, tree = self.find('.tree-holder'), val = this.getValue(); var updateFn = function() { var val = self.getValue(); if(val) { @@ -131,7 +131,7 @@ }; // Load the tree if its not already present - if(jQuery.jstree._reference(tree)) updateFn(); + if(jQuery.jstree._reference(tree) || !val) updateFn(); else this.loadTree(null, updateFn); }, setValue: function(val) {