ENHANCEMENT: removed the situation, when the user is left with empty search box and empty dropdown. (from r97793)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102533 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 23:38:57 +00:00
parent c24c9c89a2
commit b9c0a14ecc

View File

@ -114,8 +114,6 @@ TreeDropdownField.prototype = {
saveCurrentState: function() {
this.origHumanText = this.getHumanText();
this.defaultCleared = false;
this.searched = false;
},
restoreOriginalState: function() {
@ -327,7 +325,7 @@ TreeDropdownField.prototype = {
}
if (!this.treeDropdownField.treeShown) this.treeDropdownField.toggleTree();
if (!this.treeDropdownField.defaultCleared) {
if (!this.treeDropdownField.defaultCleared || !this.treeDropdownField.searched) {
this.treeDropdownField.defaultCleared = true;
this.treeDropdownField.setHumanText('');
}
@ -342,6 +340,7 @@ TreeDropdownField.prototype = {
this.addNodeClass('current');
this.tree.selected = this;
this.options.dropdownField.searched = false;
}
}