Impossible to unselect TreeDropdownField

It was impossible to unselect TreeDropdownField.
'!' operator should not be used at all and identical comparison (===) was too "strict" (self.getValue() returns string but $(node).data('id') returns number).
This commit is contained in:
uniun 2013-01-15 11:29:35 +02:00
parent 317495f8ef
commit e9ba54dec7

View File

@ -148,7 +148,7 @@
.jstree(self.getTreeConfig())
.bind('select_node.jstree', function(e, data) {
var node = data.rslt.obj, id = $(node).data('id');
if(!firstLoad && !self.getValue() === id) {
if(!firstLoad && self.getValue() == id) {
// Value is already selected, unselect it (for lack of a better UI to do this)
self.data('metadata', null);
self.setTitle(null);